How to Compare Two Tables and Return Value on Specific Parameters

Abstract: Resolve multi-criteria lookups in Excel by using INDEX and MATCH to return values based on specific parameters across two tables.

Created: 2026-09-27 by
To compare two tables and return a value based on specific parameters in Excel, use the INDEX and MATCH functions together. This approach allows you to look up data across multiple criteria by matching rows and columns dynamically. Unlike VLOOKUP, which is limited to left-to-right searches, this combination offers greater flexibility for complex table structures and parameter-based retrieval.

Understanding the Data Structure

Before writing any formulas, it is essential to clearly define the structure of both tables involved in the comparison. Typically, one table serves as the source of truth (the lookup table), while the other contains the parameters against which you want to check. For example, imagine you have a master sales log with columns for Date, Region, Product, and Sales Amount. You might have a second table listing specific dates and regions, and you want to find the corresponding sales amount from the master log. The key to success here is identifying the unique identifiers or "parameters" that link the two datasets. These could be a single column like an Employee ID, or a composite key made up of multiple columns such as Name and Department. Ensure that the data types in these parameter columns match exactly between both tables. Text values should not contain hidden spaces, and date formats must be consistent. If your tables are structured differently, consider using Power Query to normalize them before proceeding with formula-based comparisons.

Using INDEX and MATCH for Single Parameter Lookup

For simpler scenarios where only one parameter defines the row, the basic INDEX and MATCH function pair is highly effective. The MATCH function searches for a specified item in a range of cells and returns the relative position of that item. The INDEX function returns the value of a cell in a table based on the column and row number. Consider a scenario where you have a list of products in column A and their prices in column B. You want to find the price of a specific product entered in cell D1. The formula would look like this: =INDEX(B:B, MATCH(D1, A:A, 0)) Here, MATCH(D1, A:A, 0) finds the row number where the product name in D1 appears in column A. The 0 indicates an exact match. Then, INDEX(B:B, ...) retrieves the value from column B at that calculated row number. This method is robust because it does not break if you insert new columns between the lookup column and the return column, unlike VLOOKUP.

Handling Multiple Parameters with Array Formulas

When your comparison requires more than one parameter, such as looking up a value based on both a Date and a Region, you need to combine conditions within the MATCH function. This is often referred to as a multi-criteria lookup. In older versions of Excel, this required pressing Ctrl+Shift+Enter to create an array formula. In modern Excel (Office 365 and Excel 2021+), you can use dynamic arrays without special entry keys. Suppose Table 1 has Dates in column A, Regions in column B, and Values in column C. Table 2 has a target Date in E2 and a target Region in F2. To find the value in Table 1 that matches both, use this formula: =INDEX(C:C, MATCH(1, (A:A=E2)*(B:B=F2), 0)) In this formula, (A:A=E2)*(B:B=F2) creates an array of 1s and 0s. It returns 1 only where both conditions are true (i.e., the date matches AND the region matches). The outer MATCH function then looks for the first occurrence of 1 in this generated array. This technique allows you to pinpoint a single cell value based on intersecting criteria from two different tables.

Alternative Approaches and Best Practices

While INDEX/MATCH is powerful, other tools may suit your needs depending on the volume of data. For large datasets, XLOOKUP is a superior alternative available in newer Excel versions. It simplifies syntax and handles errors more gracefully. The equivalent formula for the multi-parameter scenario above using XLOOKUP is less direct but can be achieved by concatenating keys: =XLOOKUP(E2&F2, A:A&B:B, C:C) This concatenates the date and region into a single unique key for both the lookup and the search array. Additionally, if you are frequently comparing tables to highlight differences rather than just retrieving values, consider using Conditional Formatting with formulas or Power Query for merging queries. For related techniques on managing dynamic inputs, see How to populate a cell with a value depending on the selections made in two dropdown lists. This article explains how to handle user-driven changes in lookup values, which complements static table comparisons. Always validate your results by checking a few known records manually. If the formula returns #N/A, verify that there are no trailing spaces in text fields using the TRIM function, and ensure that dates are stored as serial numbers, not text strings. Proper data hygiene is often the difference between a working formula and a persistent error.

Frequently Asked Questions

What if my tables are in different workbooks?

You can reference cells in another workbook by including the file path in your formula, such as [Workbook.xlsx]Sheet1!$A:$A. However, ensure the referenced workbook is open or the path is absolute to avoid broken links when sharing files.

Why does my MATCH function return #N/A even though the data exists?

This usually happens due to data type mismatches, such as trying to match a number stored as text against a real number. Use the VALUE function or Text to Columns feature to standardize data types before running the lookup.

Can I use VLOOKUP for multiple parameters?

Standard VLOOKUP cannot handle multiple parameters directly. You must create a helper column in your source table that concatenates the multiple criteria into a single unique string, then use VLOOKUP on that combined column.

Is INDEX MATCH faster than VLOOKUP?

For small datasets, the performance difference is negligible. However, INDEX MATCH is generally more efficient because it only calculates the necessary rows and does not require scanning entire columns unnecessarily, especially in complex array formulas.

How do I handle approximate matches in multi-parameter lookups?

Exact match logic using multiplication (A=A1)*(B=B1) works for exact criteria. For approximate matches, you typically need to sort your data and use nested IF statements or specialized functions like XLOOKUP with approximate match modes, which is more complex than exact matching.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More