How to Replace VLOOKUP with INDEX and MATCH in Excel Forms
Question details
The user needs a flexible Excel formula combining INDEX and MATCH to replace a VLOOKUP formula for an employee clock-in and clock-out tracking form.

- Product
- Microsoft Excel / WPS Spreadsheet
- Device & OS
- not provided
- Scenario
- Rebuilding an employee clock-in and clock-out tracking form that requires complex data lookups based on conditional logic.
- Observed behavior
- Looking for a working formula structure using INDEX and MATCH (or modern alternatives like XLOOKUP) to reliably fetch corresponding clock-out times based on employee clock-in records.
Ensure your employee data is organized with clear column headers (e.g., Time, Action, Employee ID) and verify that you do not have merged cells within your lookup ranges.
Apply the INDEX and MATCH Formula Combination
Use a combination of IFERROR, IFS, INDEX, and MATCH functions to handle complex lookups where standard VLOOKUP functionality falls short.
While VLOOKUP only searches the first column of a range and returns a value to the right, INDEX and MATCH can look up data in any direction. When combined with IFS and IFERROR, it can handle conditional actions like distinguishing between Clock In and Clock Out events.
Click on the cell where you want to display the matched result, such as the calculated clock-out time for a specific employee.
Type the formula: =IFERROR(IFS(B2<>"Clock In","",INDEX(B3:B22,MATCH(C2,C3:C22,0))="Clock Out",INDEX(A3:A22,MATCH(C2,C3:C22,0))),"")
Update the ranges based on your actual sheet: B3:B22 for the Action column, C2 for the target Employee ID, C3:C22 for the Employee ID lookup range, and A3:A22 for the return Time column.
Press Enter to calculate the formula, then click and drag the fill handle at the bottom-right corner of the cell to copy the formula down to other rows.

Use XLOOKUP as a Modern Alternative
If your version of Excel or WPS Spreadsheet supports it, XLOOKUP is a simpler, more powerful replacement for VLOOKUP, HLOOKUP, and the INDEX/MATCH combination.
Manage Complex Data Lookups Easily with WPS Office
WPS Spreadsheet provides comprehensive support for all advanced data lookup formulas, including VLOOKUP, INDEX, MATCH, and the modern XLOOKUP function. You can easily manage complex employee attendance forms and large datasets seamlessly.
- 1. Open your data file: Launch WPS Spreadsheet and open your employee tracking form or dataset.
- 2. Access the Formula tab: Navigate to the 'Formulas' tab on the top ribbon and select 'Insert Function'.
- 3. Search for your function: Search for 'INDEX', 'MATCH', or 'XLOOKUP' in the function dialog box.
- 4. Follow the wizard: Use the intuitive formula wizard to select your lookup arrays and return arrays without typing them manually.

Frequently Asked Questions
Why use INDEX and MATCH instead of VLOOKUP?
INDEX and MATCH are more flexible than VLOOKUP. They allow you to look up values to the left of your lookup column, process faster on large datasets, and prevent your formulas from breaking if you insert or delete columns in your spreadsheet.
What does the 0 mean in the MATCH function syntax?
The 0 in the MATCH function syntax (e.g., MATCH(lookup_value, lookup_array, 0)) specifies an exact match type. It tells the function to find the first value that is exactly equal to your lookup value, rather than an approximate match.
Can I use XLOOKUP instead of INDEX and MATCH?
Yes, XLOOKUP is designed to replace both VLOOKUP and INDEX/MATCH. It is much simpler to write, defaults to exact matches automatically, and naturally supports looking up data in any direction.
Why does my INDEX MATCH formula return an #N/A error?
An #N/A error typically means the MATCH function could not find the lookup value in the lookup array. You should check for leading or trailing spaces in your text data, ensure the data types match (e.g., text vs. numbers), and verify that the lookup value actually exists in the selected range.




