Is it possible change the display format between two dates as 2 digit years, months and days

I’m using the DATEIF function to determine difference between to dates: Table 1:Start Date and dates in Table 2.  However, I need the displayed format for years, months and days in 2-digits (03 years, 01 months, 02 days).  Is this possible?  Thank you


MacBook Pro 15″, macOS 11.7

Posted on Mar 20, 2023 7:37 AM

Reply
2 replies

Mar 20, 2023 8:48 AM in response to Bear34_1

You can do something like this:



=REPT(0,2−LEN(DATEDIF(Start Date::$A$1,A2,"Y")))&DATEDIF(Start Date::$A$1,A2,"Y")& " years, " & 
REPT(0,2−LEN(DATEDIF(Start Date::$A$1,A2,"YM")))& DATEDIF(Start Date::$A$1,A2,"YM")&" months, " &
REPT(0,2−LEN(DATEDIF(Start Date::$A$1,A2,"MD")))& DATEDIF(Start Date::$A$1,A2,"MD")& " days"


More on REPT here (or at Help > Numbers Help in your menu:


REPT - Apple Support


Use ; instead of , in the formula if your region uses , as the decimal separator.


SG


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Is it possible change the display format between two dates as 2 digit years, months and days

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.