Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JD
 
Posts: n/a
Default How to add time to a cell formatted as yyyymmddhhmmss

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?

  #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?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with this conditional IF statement C-Dawg Excel Discussion (Misc queries) 3 May 15th 06 06:01 PM
Urgent date/scheduling calc needed jct Excel Worksheet Functions 3 February 24th 06 01:36 AM
enter a time into a cell, have the cell show two times the entry johnp Excel Worksheet Functions 3 May 2nd 05 12:08 AM
Combined date time cell to separate date & time components Mark Ada Excel Discussion (Misc queries) 1 December 2nd 04 12:07 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 06:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"