Hmm... I'm not sure I completely agree.
what you say at first is true, it is similar to subtracting numbers,
because:
Excel doesn't really have "dates".
It has numbers that are the total days and portions of days
since 1/1/1900.  You may choose to DISPLAY this number any
way you like.  We choose to DISPLAY it in a form that
REPRESENTS a date. But it's still just a number.

so, today, 10/9/2009 at 7:43:30 AM, Excel stores as 40095.321875
40,095 days since midnight of 1/1/1900 and .321875 of another day.

Now, if I were to subtract Monday's date: 10/5/2009 at 8:00:00 AM,
it gives me 3.9885416666657 days.  which isn't a problem.

But if I put it in "YY-MM-DD" format, it becomes:
00-01-03
which is pretty much meaningless!

(DateDiff is a VBA function, not available in Excel)

So, yes, you can subtract dates.
and yes, you can display it in "YY-MM-DD" format.

But are you sure you WANT to?

Paul



________________________________
From: Dilip Pandey <dilipan...@gmail.com>
To: excel-macros@googlegroups.com
Sent: Friday, October 9, 2009 12:59:36 AM
Subject: $$Excel-Macros$$ Re: Subtract dates


Hi Huzaifa,

Yes, it is possible.  It is similar as you subtract number in Excel, after that 
you have to change the cell format to "YY-MM-DD" format.
Alternatively, you can also use DATEDIF function, to get the difference as per 
your choice i.e. months, completed months, years etc.

-- 
DILIP KUMAR PANDEY  
   MBA-HR,B COM(Hons.),BCA
Mobile: +91 9810929744
dilipan...@gmail.com
dilipan...@yahoo.com
New Delhi - 110062 

 
On 10/2/09, Huzaifa <pastaw...@gmail.com> wrote: 

>Is it possible to subtract dates in Microsoft Excel and get the result
>in yy-mm-dd format? Please help me.
>Thanks
>
>>
>
--~--~---------~--~----~------------~-------~--~----~
----------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,500 subscribers worldwide and receive many nice notes about the 
learning and support from the group. Our goal is to have 10,000 subscribers by 
the end of 2009. Let friends and co-workers know they can subscribe to group at 
http://groups.google.com/group/excel-macros/subscribe
-~----------~----~----~----~------~----~------~--~---

Reply via email to