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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date function in Excel

Status
Not open for further replies.

MBLR

IS-IT--Management
Jun 13, 2002
89
IN
Assume that I have three cells. I will enter date1 in first cell and date2 in second cell. Can I get the difference in month in third cell?

For Eg:
Date 1 Date 2 Result in months
_______________________________________________
| 23/1/2002 | 22/2/2002 | 1 |
-----------------------------------------------
 
If dates appear in A1 and B1, try this formula in C1:

=MONTH(B1-A1)

Make sure that C1 is formatted as GENERAL
 
Define "Month" - do you mean number of full calendar months , no. of 30 day blocks ....it makes a difference Rgds
~Geoff~
 
This is a bit long winded, but

=IF(YEAR(C17)>YEAR(B17),SUM((YEAR(C17)-YEAR(B17))*12,MONTH(C17),12-MONTH(B17)),MONTH(C17)-MONTH(B17))

seems to work OK.

BUT it won't work if the date in column B is earlier than that in column A - if this is likely to happen then some more work will be required on the formula!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top