As shown in the following figure, the company stipulates that the seniority pay of 50 yuan per year, the 20 cap, that is, beyond 20 also in accordance with the 20 accounting, then how to calculate the seniority of workers according to the date of salary?
The example tutorial is as follows:
① the name of the salesperson and the date of entry, which stipulates that the job seniority wages is 50 yuan per year, capped 20, first of all, we enter in the C2 cell: =min (20,datedif (B2,today (), "Y") *50.
② carriage return, get results 650, because Sun Ning is 2000, now 2013, 13 years, 13*50=650, the answer is correct.
③ Double-click the cell fill handle to complete the calculation of the following cells.
Formula description
DATEDIF (start date, end date, "Y"/"M"/"D"): Calculates the number of years between the start and end dates, or the number of days of the month.
First use the DATEDIF function to calculate the seniority, if the seniority is less than 20, then return this value less than 20, if greater than the 20,min function will return 20, and then multiplied by 50.