Date formating yymm

  • Thread starter Thread starter sconstance
  • Start date Start date
S

sconstance

I'm trying to take a start and end day and figure out how many years and
months is inbetween. Except I need the outcome to be in the format of yymm. I
can get just the number of months easy but can't figure out a way to get it
in that format.

Ex End Date - 2/1/2031 Start Date - 1/1/2008 = 277.22 months (rounded
to) 277 months

But I need the cell to return 2301 for 23 years 01 months
 
Divide the value by 12 to get years. Use the MOD function to get the
remaining months.
 
=INT(A1/12)&TEXT(MOD(A1,12),"00")

But look here for a more precise way:

http://www.cpearson.com/excel/datedif.aspx

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| I'm trying to take a start and end day and figure out how many years and
| months is inbetween. Except I need the outcome to be in the format of yymm. I
| can get just the number of months easy but can't figure out a way to get it
| in that format.
|
| Ex End Date - 2/1/2031 Start Date - 1/1/2008 = 277.22 months (rounded
| to) 277 months
|
| But I need the cell to return 2301 for 23 years 01 months
 
Back
Top