Function Problems

How to Combine IF and VLOOKUP to Return a Manager Name and Email in WPS Office Spreadsheets

Nimra MalikNimra Malik Nov 13, 2026 869 views

Question details

The user needs to combine IF and VLOOKUP in WPS Office Spreadsheets to return a manager name and email based on the Report To employee ID and the manager's job-title rank.

Product
WPS Office Spreadsheets
Device & OS
not provided
Scenario
The user is working with an employee lookup table and must select a manager by the Report To employee ID and the manager's job-title rank.
Observed behavior
The lookup requires nested IF and VLOOKUP formulas to return the correct manager name and email from the employee table.
Before you start

Verify that your employee table is in a range similar to A2:F14, with employee IDs in column A, manager names in column C, job-title rank in column D, email addresses in column E, and Report To IDs in column F. Adjust the column numbers in the formulas below if your workbook layout differs.

Solution 1Recommended

Use nested IF and VLOOKUP formulas in G2 and H2

Use this solution when you need to return a manager name and email based on the Report To employee ID and job-title rank.

This method nests VLOOKUP inside IF to decide whether to use the Report To ID directly or look up the next manager ID when the job-title rank is 0. The same pattern populates the manager name in G2 and the email in H2.

1
Select the manager name cell

Click cell G2 in the WPS Spreadsheets worksheet that contains your employee table.

2
Enter the manager name formula

Type =IF(F2="","",VLOOKUP(IF(VLOOKUP(F2,$A$2:$F$14,4,FALSE)=0,VLOOKUP(F2,$A$2:$F$14,6,FALSE),F2),$A$2:$F$14,3,FALSE)) and press Enter.

3
Fill the manager name formula down

Select G2 again, drag the fill handle down through G14 or your last data row to copy the formula for all employees.

4
Enter the manager email formula

Click cell H2, type =IF(F2="","",VLOOKUP(IF(VLOOKUP(F2,$A$2:$F$14,4,FALSE)=0,VLOOKUP(F2,$A$2:$F$14,6,FALSE),F2),$A$2:$F$14,5,FALSE)) and press Enter.

5
Fill the email formula down

Drag the fill handle from H2 down through the last data row to apply the email lookup to all rows.

Formulas return the correct manager: If you see #N/A, check that all Report To IDs exist in column A and that your lookup range and column indexes match your table.
WPS Spreadsheets formula help

Return Manager Details with WPS Office Spreadsheets

WPS Office Spreadsheets supports the same IF and VLOOKUP combinations as Excel, so you can return a manager name and email using the same formula without changing your file.

  1. 1. Open your workbook in WPS Spreadsheets: Launch WPS Office Spreadsheets and open the employee workbook that contains the table and Report To IDs.
  2. 2. Enter the nested manager formula: Click G2 and enter the IF/VLOOKUP formula shown above to return the manager name.
  3. 3. Enter the email formula: Click H2 and enter the email version using the final column index 5.
  4. 4. Fill formulas down the columns: Drag the fill handle from G2 and H2 down through your data rows to populate the results.
  5. 5. Verify and save the workbook: Check the returned manager names and emails, then save the file in .xlsx format.
Uses the familiar Excel IF and VLOOKUP syntax.Fully compatible with .xlsx workbooks and formulas.Free, lightweight WPS Office Spreadsheets with function autocomplete.Simplifies filling nested lookups across large employee lists.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the formula return a blank cell?

The formula starts with IF(F2="","",...), so it returns a blank when the Report To ID in F2 is empty. Enter a valid Report To employee ID to get a result.

What should I change if my email column is not column E?

In the H2 formula, change the final VLOOKUP column index from 5 to the actual email column number in your lookup range.

How do I apply the formulas to all rows?

Select G2, drag the fill handle down through the rows, then do the same in H2. WPS Spreadsheets adjusts the row references automatically.

What does the job-title rank check do?

It looks up the Report To employee’s rank in column D. If the rank is 0, the formula picks the next manager value from column F for the outer VLOOKUP; otherwise it uses the Report To ID directly.

Why do I get a #N/A error?

Check that the Report To ID exists in the first column of A2:F14 and that the range and column indexes match your actual table.