View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Chip Pearson
 
Posts: n/a
Default How to add time to a cell formatted as yyyymmddhhmmss

When you use the TIME function, it will automatically roll-over
hours at 24:00:00. Thus TIME(25,0,0) gets rolled over to be the
equivalent of TIME(1,0,0).

Try

=B1+(A1/24)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"JD" wrote in message
oups.com...
How can a number of hours be added to a cell and both the time
and date
increment correctly?

For example, A1 = 25, B1 = 0:00:00. I want to add A1 and B1 to
get C1.
The Custom format for C1 is yyyymmddhhmmss. Both the time and
date
need to change correctly.

I'm using the following function in C1: B1 + TIME(A1,0,0)

I realize I probably need a date function too but I do not know
which
one or how to use it to do what I need.

The time is incremented correctly (0:59:00), but the date is
incorrect.
The date is 01/01/1900 but should be 01/02/1900.

Any ideas?