how to calculate the substraction between two dates

E

EXCEL$B!!(BNEWS

hi,

i have two cells ,in which there are two dates.
(for instance ,one cel l 08/02 ,the other 07/30)

if the gap of the two dates is 2 days , something will be set to do.

but it is difficult to judge the the substraction between two dates

any good ideas.

thanks
 
M

Max

Perhaps this might be of help ..

Assume the *dates* "2-Aug-2004" and "30-Jul-2004"
are input in A1 and B1, and
A1:B1 is custom formatted as: mm/dd
viz. it'll show as:

In A1: 08/02
In B1: 07/30

Try in C1: =DAY(ABS(A1-B1))-1
Format C1 as: General or Number

C1 will return: 2
i.e. the number of days in-between the 2 dates in A1:B1
 
C

Chip Pearson

Try in C1: =DAY(ABS(A1-B1))-1


That method will work only if the difference between the two
dates is <= 31 days. Better to simply subtract one date from the
other, and format for General.


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

Max

Chip Pearson said:
That method will work only if the difference between the two
dates is <= 31 days. Better to simply subtract one date from the
other, and format for General.

Yes, you're right.
Thanks for the correction, Chip
... I goofed, plain and simple ..
 
Top