Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel: Number of days between two dates

Status
Not open for further replies.

Bug16

Technical User
Oct 2, 2002
22
GB
Probably mind bogglingly simple for some here but I'm struggling to work out the number of days between two dates.

Surely there's a very simple neat way of doing this?
 
if u don't care about weekends then it's simply later date minus earlier date. (eg C2-B2)
 

Just to add to onedtent's reply, you will also need to format the cell with the calculation in it (eg =c2-b2)to 'number' format which will give you the number of days between the two dates.

You can also look at it in terms of years, months & days too using Datedif worksheet function

Try putting this formula in, again with your dates in a1 (oldest date) & a2 (newest date) to see what I mean.

=DATEDIF(A1,A2,"Y")&" Years and "&DATEDIF(A1,A2,"YM")&" Months and "&DATEDIF(A1,A2,"MD")&" Days"

regards,


mudstuffin
 
I am assuming you are trying to calculate number of days excluding Saturday and Sunday. You can use the built in function, Networkdays to do that.

Search the help file in Excel for more information by typing Networkdays on the office assistance
 
Another extra note - NETWORKDAYS is only available if you have installed the analysis toolpak (Tools>Addins>Analysis Toolpak) Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
That is why I could never get Networkdays to work then. I didn't realise it was part of an addin. Nick (Everton Rool OK!)
 
Free Addin tho - should be there and available - you just need to go to Tools>Addins and select it from the list Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
I need to include the working days but =NETWORKDAYS(cellpos1,cellpos2) does the trick! I knew it'd be something simple! :)

Thanks for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top