ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   furmula to add hours (https://www.excelbanter.com/excel-programming/403918-furmula-add-hours.html)

Stephen[_24_]

furmula to add hours
 
I have a cell (B3) that is a date formatted as 01/01/08 0:00:00
I want a formula in another cell (D3) that takes the value of B3 and adds
time to it.

eg.

B3 - 01/01/08 00:00:00
D3 - 01/01/08 23:59:59

??

Roger Govier[_3_]

furmula to add hours
 
Hi

Try
=B3+TIME(23,59,59)

Since time is stored as fractions of a day, you could also use
=B3+3.5/24 to add 3 hours 30 minutes to the value in B3

--

Regards
Roger Govier

"Stephen" wrote in message
...
I have a cell (B3) that is a date formatted as 01/01/08 0:00:00
I want a formula in another cell (D3) that takes the value of B3 and adds
time to it.

eg.

B3 - 01/01/08 00:00:00
D3 - 01/01/08 23:59:59

??



Chip Pearson

furmula to add hours
 
Dates are stored by Excel as a number with the format dddd.ttttt where dddd
is the number of days since 0-Jan-1900 and tttt is a fraction of a 24-hour
day (e.g., 6:00 = 0.25, 12:00 = 0.5, 18:00 = 0.75, etc). Thus, you need to
strip the date component off of the second datetime before adding it to the
first.

=A1+B1-INT(B1)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting LLC
www.cpearson.com
(email on the web site)


"Stephen" wrote in message
...
I have a cell (B3) that is a date formatted as 01/01/08 0:00:00
I want a formula in another cell (D3) that takes the value of B3 and adds
time to it.

eg.

B3 - 01/01/08 00:00:00
D3 - 01/01/08 23:59:59

??




Stephen[_24_]

furmula to add hours
 
Good stuff. thanks!

"Roger Govier" wrote:

Hi

Try
=B3+TIME(23,59,59)

Since time is stored as fractions of a day, you could also use
=B3+3.5/24 to add 3 hours 30 minutes to the value in B3

--

Regards
Roger Govier

"Stephen" wrote in message
...
I have a cell (B3) that is a date formatted as 01/01/08 0:00:00
I want a formula in another cell (D3) that takes the value of B3 and adds
time to it.

eg.

B3 - 01/01/08 00:00:00
D3 - 01/01/08 23:59:59

??




All times are GMT +1. The time now is 09:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com