Link to home
Start Free TrialLog in
Avatar of TIMFOX123
TIMFOX123Flag for United States of America

asked on

in excel how do I format the date like this 2011-04-21 06:00:00 for 50 hours from now ?

I want my spreadsheet to format the date like this 2011-04-21 06:00:00
and I want one cell to be 50 hours from now

Another cell 2 weeks & 6  hours ahead

excell 2007 :)

Avatar of SiddharthRout
SiddharthRout
Flag of India image

>>> I want my spreadsheet to format the date like this 2011-04-21 06:00:00

Format(Range("A1").Value,"YYYY-MM-DD HH:MM:SS")

Sid
Oops and to Add time

=NOW()+"50:00:00"

and for

Another cell 2 weeks & 6  hours ahead

=NOW()+"174:00:00"

Sid
If you are looking for a formula to format time then you can do this

=TEXT(A1,"YYYY-MM-DD HH:MM:SS")

or right click on the cell and click on format cells. The in Custom, Type

YYYY-MM-DD HH:MM:SS

Hope this helps.

Sid
ASKER CERTIFIED SOLUTION
Avatar of SiddharthRout
SiddharthRout
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
"Format Cells" for the date fields and in the Number tab select Custom from the Category field then enter the following in the "Type:" field

yyyy-mm-dd hh:mm:ss

When manipulating Excel Date fields mathematically you need to know that 1=24hrs. So to add 50hrs to a date field you have to divide it by 24.

The formula for the 50+ hour field (using A1 as the original date field)

=A1+50/24

For 2 weeks 6 hours

=A1+14.25
Avatar of TIMFOX123

ASKER

this is a huge saver for a project I am doing
thx a bunch