ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Date formating yymm (https://www.excelbanter.com/excel-discussion-misc-queries/182538-date-formating-yymm.html)

sconstance

Date formating yymm
 
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

Castell

Date formating yymm
 
Divide the value by 12 to get years. Use the MOD function to get the
remaining months.


"sconstance" wrote in message
...
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



Niek Otten

Date formating yymm
 
=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

"sconstance" wrote in message ...
| 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




All times are GMT +1. The time now is 03:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com