Excel Formula: Returning List Values Based on Multiple Criteria

Abstract: Retrieve values from Excel datasets by matching multiple criteria simultaneously using INDEX and MATCH with array logic.

Created: 2026-07-29 by

To return list values based on multiple criteria in Excel, use the INDEX and MATCH functions combined with array logic. By multiplying your criteria ranges against boolean arrays (using -- or *), you can create a single lookup key that matches all conditions simultaneously, providing a robust solution for complex data retrieval tasks.

Understanding the Core Challenge

When working with large datasets in Microsoft Excel, simple lookups often fall short. The standard VLOOKUP function is limited to searching only the first column of a table array and cannot natively handle multiple search criteria without concatenating helper columns. Similarly, while XLOOKUP offers more flexibility, it still requires specific setup to handle multiple independent conditions effectively. The most common scenario involves retrieving a value from a result column where two or more other columns must match specific inputs simultaneously. For example, finding a price based on both a Product ID and a Region, or locating an employee's department based on their Name and Job Title. This limitation forces many users to rely on cumbersome workarounds or pivot tables, which are not dynamic enough for real-time spreadsheet needs. To solve this efficiently, we need a formula that evaluates each criterion independently and ensures they are all true before returning the desired result. This approach maintains data integrity and allows for dynamic updates as the underlying dataset changes. If you frequently deal with structured data across different dimensions, exploring how to manage name lists in separate columns can also streamline your overall data architecture.

The INDEX and MATCH Combination

The most reliable method for multi-criteria lookups involves combining INDEX with MATCH. Unlike VLOOKUP, MATCH can search any row or column, and INDEX can return a value from any position in a range. When used together, they offer superior performance and flexibility. However, to incorporate multiple criteria, we must modify the MATCH function to accept an array of conditions. The key lies in creating a unique "lookup value" by concatenating the criteria within the formula itself, or by using array multiplication. Array multiplication is generally preferred because it avoids text formatting issues that can arise with concatenation, such as leading zeros or inconsistent spacing. By converting logical tests into 1s and 0s, we create a mathematical representation of our criteria. This technique is essential for anyone looking to update Excel formulas with ease when dealing with complex dependencies.

Step-by-Step Implementation Guide

Let us assume you have a dataset with the following structure: - Column A: Product Name - Column B: Category - Column C: Price - You want to find the Price (Column C) where Product Name equals "Widget" AND Category equals "Electronics". Follow these steps to construct the formula:
  1. Identify Your Ranges: Determine the exact cell ranges for each criterion and the result column. Let A2:A100 be the Product Names, B2:B100 be the Categories, and C2:C100 be the Prices.
  2. Construct the Criteria Arrays: Inside the MATCH function, you will compare your input values against the respective ranges. For the product name, use (A2:A100="Widget"). This returns an array of TRUE/FALSE values.
  3. Convert to Numbers: To multiply these arrays, convert the booleans to numbers using the double unary operator -- or by multiplying by 1. So, --(A2:A100="Widget") becomes an array of 1s and 0s.
  4. Multiply the Criteria: Combine the converted arrays using multiplication: --(A2:A100="Widget") * --(B2:B100="Electronics"). This results in a single array where only the rows matching BOTH criteria have a value of 1, and all others are 0.
  5. Set the Lookup Value: In the first argument of MATCH, enter the number 1. This tells Excel to find the first occurrence where the combined criteria equal 1.
  6. Wrap with INDEX: Use the row number returned by MATCH inside INDEX to retrieve the corresponding price from the result column.
The final formula structure looks like this:
=INDEX(C2:C100, MATCH(1, (--(A2:A100="Widget")) * (--(B2:B100="Electronics")), 0))
Note that in older versions of Excel (pre-Office 365), you must press Ctrl+Shift+Enter to confirm this as an array formula. In modern Excel, simply pressing Enter is sufficient due to dynamic array handling.

Handling Text and Numeric Criteria

While the multiplication method works perfectly for exact matches, it is important to note that it is case-insensitive. If you need case-sensitive matching, you would require a different approach involving EXACT or FIND functions, though this is rarely necessary for standard business data. Furthermore, if your criteria involve dates or numbers, ensure that the data types in your ranges match the data type of your lookup values. Mismatched types can lead to zero results even when visually the data appears correct. For instance, if your Product ID is stored as text but you search for a number, the match will fail. Always check your column formats. If you are struggling with conditional formatting not working alongside these cell formulas, it is often due to similar data type mismatches or absolute/relative reference errors. Ensuring consistency in data entry practices significantly reduces the need for complex error-handling wrappers in your formulas.

Common Pitfalls and Troubleshooting

One frequent error is the #N/A result. This indicates that no row satisfied all the multiplied conditions. Verify that there are no trailing spaces in your source data, as "Widget " is not equal to "Widget". Using the TRIM function on your source data can prevent this issue. Another common mistake is referencing the wrong column in the INDEX function. Remember, INDEX returns the value from the specified range at the row number found by MATCH. If you swap the ranges, you might get incorrect data back. Additionally, if your dataset grows, ensure your ranges expand accordingly. Using Excel Tables (created via Ctrl+T) automatically expands these ranges, making your formulas future-proof. This is particularly useful when counting new items between two lists in Excel, as structured references simplify the comparison logic.

Alternatives for Modern Excel Users

If you are using Microsoft 365, XLOOKUP provides a cleaner syntax for some scenarios, although it still benefits from array logic for multiple criteria. You can combine XLOOKUP with the same multiplication trick:
=XLOOKUP(1, (--(A2:A100="Widget")) * (--(B2:B100="Electronics")), C2:C100)
This version is slightly easier to read as it does not require nested INDEX functions. However, the INDEX/MATCH method remains universally compatible with all Excel versions, making it the safest choice for shared files across different organizational setups.

Frequently Asked Questions

Why does my formula return #N/A even when the data exists?

This usually happens because of hidden characters or data type mismatches, such as text stored as numbers. Ensure your lookup values exactly match the format of the cells in your range, including removing extra spaces with the TRIM function.

Can I use OR logic instead of AND logic for multiple criteria?

Yes, but you cannot use simple multiplication for OR logic. Instead, you should add the boolean arrays together and check if the sum is greater than zero, or use the SUMPRODUCT function with explicit logical tests. For example, checking if either condition is met requires a different mathematical approach than the AND logic shown here.

Is there a limit to the number of criteria I can add?

Technically, you can add as many criteria as you have memory to support, but each additional criterion multiplies the computational load. It is best practice to keep multi-criteria lookups under five conditions to maintain optimal spreadsheet performance and readability.

How do I make this formula return all matches instead of just the first one?

The standard INDEX/MATCH combination only returns the first match. To return all matches, you would need to use dynamic array functions like FILTER in newer Excel versions, which can return an array of all rows that satisfy the multiple criteria simultaneously.

Does this method work with filtered lists?

No, standard INDEX/MATCH formulas ignore visible filter settings and search the entire underlying dataset. If you need to search only within currently visible rows after applying filters, you must use specialized techniques involving the SUBTOTAL function or Power Query.

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