How to calc # of days between two dates in YYYYMMDD in EXCEL.

A

ahsan

I have two dates in YYYYMMDD format in Excel. How can calculate number of
days between the two dates?
 
S

SteveG

Ahsan,


Assuming your dates are in A1 & B1,

=DATEDIF(A1,B1,"d")

The first date in the formula needs to be the earlier of the two.


HTH

Steve
 
P

Philip Reece-Heal

If first date is in A1 and second is in A2, in A3 type the formula =A1-A2
and you will have the answer but formatted as a date, so while in the same
cell (A3) from the Format menu click on Cells and then select the Number
tab. In the box on the left select General. Answer is now a number

All the best
Philip
 
J

JE McGimpsey

One way:

=DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2)) -
DATE(LEFT(A2,4),MID(A2,5,2),RIGHT(A2,2))
 
Top