Return Benefit Package Labels by Years of Service in Excel
Question details
Assign a benefit package label based on an employee's length of service.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Years of service are entered in a worksheet, and each employee needs an A1, A2, or A3 benefit package label.
- Observed behavior
- The desired result is A1 for less than two years, A2 for two to less than five years, and A3 for five years or more.
Enter years of service as nonnegative numbers in column C, starting at C2. Choose an empty cell for the benefit label; the examples below use D2.
Use LOOKUP to assign labels from service thresholds
Use this formula to match each service value to the appropriate lower threshold and leave empty input cells blank.
LOOKUP selects the largest threshold that is less than or equal to the value in C2. The thresholds must remain in ascending order, and this formula assumes service values are nonnegative.
Select D2 and enter =IF(C2="","",LOOKUP(C2,{0,2,5},{"A1","A2","A3"})).
Select D2 and drag its fill handle down column D to copy the formula to the remaining employee rows.
Enter sample values in column C: 1.5 should return A1, 2 should return A2, and 5 should return A3.

Use nested IF formulas to assign benefit labels
Use nested IF statements if you prefer to express each range as a direct comparison.
Assign benefit labels by service range in WPS Spreadsheets
Use a nested IF formula in WPS Spreadsheets to return A1, A2, or A3 for each employee's years of service and keep blank inputs empty.
- 1. Open the spreadsheet: Open WPS Office, select Spreadsheets, and open your employee workbook.
- 2. Check the service values: Enter or verify nonnegative years of service in column C, starting at C2.
- 3. Enter the label formula: Select D2 and enter =IF(C2="","",IF(C2<2,"A1",IF(C2<5,"A2","A3"))).
- 4. Fill the remaining rows: Drag the fill handle from D2 down column D, then use Save to save the workbook.

Frequently Asked Questions
Which label does an employee with exactly two years of service receive?
The employee receives A2. In the formulas, A1 applies below 2, while A2 begins at 2 and continues up to, but not including, 5.
What happens when the years-of-service cell is empty?
The outer IF(C2="","",...) in either formula returns an empty string, so the benefit label cell appears blank.
Why does the LOOKUP formula return #N/A?
A negative value in C2 is below the first threshold of 0, so LOOKUP cannot find a match. Check that the service value is a nonnegative number.
How do I use the formula if years of service are in another column?
Replace each C2 reference in the formula with the cell containing the first employee's service value, then copy the formula down using the fill handle.




