There are several variations available (e.g.
time in months, time in months ignoring days and years, etc.)
and these are set by the “unit” argument in the function.
Seethis page on the DATEDIF functionfor a full list of available units.
for use the LET function on this formula, we need to think about variables.
Looking at the formula, there are at least five opportunities to declare variables.
The first two are thestartdate and theenddate, which are reused throughout the formula.
Once we assign values tostartandend, we only need to refer to cells C5 and D5 one time.
Thestartandenddates are then reused throughout the formula.
This makes it easier to read the formula and helps reduce errors.
The next three opportunities for variables are the results from DATEDIF foryears,months, anddays.
With the LET function, the lastargumentis the calculation or value that returns a final result.
year" not “years”).
Then we use the IF function to conditionally tack on an “s” only when the number isnot1.
If the numberis1, IF returns anempty string("") and the unit name remains singular.
See more details about theLET function here.
Also, see theDetailed LET function examplefor another explanation of converting an existing formula to use LET.
The DATEDIF (Date + Dif) function is a “compatibility” function that comes from Lotus 1-2-3.