I want to subtract 2 dates in Excel but the problem is they have different date formats. So... my first date is something like this 18.09.2011 (DD.MM.YYYY) and the second one is something like 9/15/2011 (MM/DD/YYYY). So how can I subtract these two dates? Because DAY(cell of date one) - DAY (cell of date 2) won't work. Thanks!
Asked
Active
Viewed 9,380 times
2
-
3Convert dates to the same format first, then substract. I had the very same problem here: [VBA excel, changing date format](http://stackoverflow.com/questions/7106238/vba-excel-changing-date-format) If you don't want to use vba there's a formula in the last answer. – Jandrejc Sep 15 '11 at 11:40
-
1Format has no impact on date operations. You probably speak about date *strings* ? If that is the case you should rephrase your question. – iDevlop Sep 16 '11 at 07:56
1 Answers
3
If your dates are really entered as dates you can use them in any kind of calculation, as a date really is stored as a numeric value. Displaying one date in "MM/DD/YY" and the other one in "DD.MM.YYYY" doesn't make a difference. Try to format the cells as "General". Does the display change to a number (e.g. 40801 for today) you're fine. If your dates are entered as strings you may want to convert them into dates first - see this post