furmula to add hours

S

Stephen

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

??
 
R

Roger Govier

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
 
C

Chip Pearson

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)
 
S

Stephen

Good stuff. thanks!

Roger Govier said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top