# Formula/function needed for calculating employee's year, month, day at specific rank, like Patrol, Corporal, Sgt., etc., for seniority.

#### cricket1001

##### New Member
I have been searching and trying numerous ways to find a formula, function to use to determine employee's seniority by year, month, & day according to their rank.
I've tried using IF function, but was confused in how to put a DATEDIF inside an IF function.

Thanks

#### AlanSidman

##### Active Member
Show us a sample report with mocked up results, ie. Before and After scenario.

#### Peter Bartholomew

##### Well-Known Member
Are you trying to compare the seniority of different employees or simply achieve a table showing the seniority of each employee at a given date? The first can be done by measuring seniority in days
= today - [@ApptDate]
Such measures can be compared and differences calculated, positive or negative.
If the objective is to get a pretty layout, then the formulas
= DATEDIF( [@ApptDate], today, "y" )
= DATEDIF( [@ApptDate], today, "ym" )
= DATEDIF( [@ApptDate], today, "md" )

give the values, though the days can occasionally be incorrect.