Function Problems

Use Excel INDEX and MATCH to Find a Manager by Badge Number and Month

Amos GikundaAmos Gikunda Dec 2, 2026 868 views

Question details

Return the correct manager for an employee based on badge number and selected month.

Find a Manager by Badge Number and Month with Excel INDEX and MATCH
Product
Microsoft Excel
Device & OS
not provided
Scenario
An employee table needs to look up managers from a second table where assignments change each month.
Observed behavior
The desired result is the manager at the intersection of the employee's badge-number row and the selected month's column.
Before you start

Identify the badge-number column, month header row, and manager data range in the lookup table. Make sure the badge and month lookup values match the underlying values in that table, including text-versus-number and date differences.

Solution 1Recommended

Use INDEX and MATCH for a two-way manager lookup

Use this formula when badge numbers identify rows and months identify columns in the manager table.

In this example, A3:A10 contains badge numbers, B2:F2 contains month headers, and B3:F10 contains manager names. The badge to find is in B19, and the selected month is in B15.

1
Select the result cell

In the employee table, click an empty cell such as C19 where you want the manager's name to appear.

2
Enter the lookup formula

Type =INDEX($B$3:$F$10,MATCH(B19,$A$3:$A$10,0),MATCH($B$15,$B$2:$F$2,0)) and press Enter.

3
Apply it to other employees

Drag the fill handle from C19 down the result column. The badge reference changes by row, while the lookup ranges and selected month remain fixed.

Use INDEX and MATCH for a two-way manager lookup
Check exact matches: Both MATCH functions use exact matching. If the formula returns #N/A, check that the badge and month exist and have matching underlying values. A date displayed as a month may not match a text month or a different date.
WPS Spreadsheets

Look up monthly managers in WPS Spreadsheets

Use the same INDEX and MATCH formula in WPS Spreadsheets to find a manager at the intersection of a badge-number row and a month column.

  1. 1. Open the workbook: Open WPS Spreadsheets and select Open to load your employee and manager tables.
  2. 2. Check the lookup ranges: Confirm that A3:A10 holds badge numbers, B2:F2 holds months, and B3:F10 holds manager names, or adjust the formula ranges to match your sheet.
  3. 3. Enter the formula: Select an empty result cell and enter =INDEX($B$3:$F$10,MATCH(B19,$A$3:$A$10,0),MATCH($B$15,$B$2:$F$2,0)), then press Enter.
  4. 4. Fill the results: Drag the result cell's fill handle down to look up the manager for each employee badge.
Find rotating managers with a two-way lookupOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and cell references
microsoft office alternative - wps office

Frequently Asked Questions

Why does the formula return #N/A?

One of the MATCH functions cannot find an exact match. Check B19 against the badge column and B15 against the month headers, including whether values are stored as text, numbers, or dates.

Can I copy the formula down for other employees?

Yes. Drag the result cell's fill handle down. B19 changes to the badge cell in each row, while the dollar signs keep the lookup ranges and B15 fixed.

What if the month header displays correctly but still does not match?

Check the underlying values in B15 and the month header. For example, a text value such as January will not exactly match a date formatted to display January, and two dates in the same displayed month may still differ.

What happens if a badge number appears more than once?

MATCH returns the position of the first exact match. Use unique badge numbers in the lookup column if each employee should have one manager row.