Excel XLOOKUP Formula: Positioning Criteria with Two Criteria

Abstract: Retrieve values based on two criteria using XLOOKUP with an array multiplier instead of helper columns or legacy INDEX/MATCH formulas.

Created: 2026-08-29 by

Use the XLOOKUP function with an array multiplier to combine two criteria. Multiply boolean arrays from your lookup ranges using asterisks, then wrap them in parentheses to find the first match. This method is faster and more reliable than older INDEX/MATCH combinations for multi-column lookups.

Understanding the Logic of Combined Criteria

When you need to retrieve a value based on two distinct conditions, standard single-criteria functions like VLOOKUP or basic XLOOKUP will fail because they only check one column at a time. The solution lies in creating a unique key for each row by combining the two search values into a single logical expression. In Excel, logical operations return either TRUE (1) or FALSE (0). By multiplying these boolean results, you create a scenario where only the row that satisfies both conditions equals 1. All other rows will result in 0 because any multiplication involving a FALSE value yields zero. This allows XLOOKUP to search for the number 1 within this generated array of ones and zeros, effectively pinpointing the exact intersection of your two criteria. For example, if you are looking for a specific Product ID in column A and a specific Region in column B, you do not need to concatenate text strings. Instead, you let Excel handle the math. This approach is significantly more efficient than helper columns and avoids errors associated with text formatting inconsistencies. If you are transitioning from older methods, you might have encountered issues with legacy functions. You can read more about common errors here: Resolving '#NAME' Error in XLOOKUP: Convert from VLOOKUP in Excel.

Step-by-Step Implementation Guide

To implement this formula correctly, follow these precise steps. Ensure your data is structured in contiguous ranges, as XLOOKUP requires matching dimensions for its arguments.
  1. Identify Your Lookup Values: Determine the two specific values you want to match against. For instance, let's say you want to find the price for "Widget" (in cell E2) located in the "North" region (in cell F2).
  2. Select the First Lookup Range: Click on the column containing the first criterion, such as Column A for Product Names.
  3. Select the Second Lookup Range: Click on the column containing the second criterion, such as Column B for Regions.
  4. Construct the Array Formula: Enter the following structure into your target cell:
=XLOOKUP(1, (Range1=LookupValue1)*(Range2=LookupValue2), ReturnRange)
Let's break down the components:
  • 1: This is the lookup_value. We are searching for the number 1, which represents a true match for both conditions.
  • (Range1=LookupValue1): This creates an array of TRUE/FALSE values comparing the first range to the first lookup value.
  • *: The asterisk acts as the AND operator. It multiplies the two boolean arrays together.
  • (Range2=LookupValue2): This creates the second array of TRUE/FALSE values.
  • ReturnRange: The column from which you want to extract the final result.
This syntax works in Excel 365, Excel 2021, and later versions. Because it relies on dynamic array behavior, it automatically spills or returns a single scalar value without requiring Ctrl+Shift+Enter, unlike legacy array formulas.

Handling Multiple Matches

By default, XLOOKUP stops at the first occurrence. If your dataset contains duplicate entries for the same product and region combination, you may need to decide which value to return. You can use the optional match_mode argument to control this behavior. If you want to find the last occurrence instead of the first, add -1 as the fourth argument:
=XLOOKUP(1, (A2:A100=E2)*(B2:B100=F2), C2:C100, , -1)
However, if you need to sum all values that match both criteria rather than returning just one, XLOOKUP is not the right tool. In such cases, consider using SUMPRODUCT. For grouping similar values or aggregating data, refer to our guide on Excel Formula to group similar values.

Common Pitfalls and Troubleshooting

Even with correct syntax, users often encounter issues due to data type mismatches. Ensure that the lookup values are of the same data type as the range values. If your criteria are stored as numbers but your lookup range contains text representations of numbers (indicated by a green triangle in the corner of the cell), the formula will return #N/A. Additionally, blank cells can cause unexpected results. If your lookup ranges contain empty cells, the comparison logic might behave inconsistently depending on whether the lookup value itself is blank. To mitigate this, ensure your ranges do not include unintended blanks or use filtering to clean the source data. For strategies on managing empty data points, see Excel: Ignoring Blank Cells in a Specific Formula. Another common error occurs when the ranges are not the same size. XLOOKUP is strict about dimension alignment. If Range1 is A2:A100 and Range2 is B2:B101, the formula will throw an error. Always verify that your ranges start and end at the exact same row indices.

Alternatives for Cross-Platform Needs

While this technique is native to Excel, many users work across platforms. Google Sheets also supports similar array logic, though the syntax for array literals differs slightly. If you are migrating workflows between Excel and Sheets, understanding how to apply criteria-based logic is essential. You can explore how Google Sheets Formula: Add Values to Different Columns Based on Specific Criteria handles complex conditional logic to adapt your skills across environments.

Frequently Asked Questions

Can I use XLOOKUP with three criteria?

Yes, simply extend the multiplication chain. Add another set of parentheses for the third range and multiply it with the existing result. The formula becomes =XLOOKUP(1, (R1=L1)*(R2=L2)*(R3=L3), Ret). This scales linearly for any number of conditions.

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

This is usually caused by hidden spaces or data type mismatches. Check if your lookup values have leading/trailing spaces by using the TRIM function. Also, verify that numbers in your range are not formatted as text, which prevents logical equality checks from succeeding.

Is this method slower than VLOOKUP with helper columns?

Generally, no. While helper columns require manual maintenance and recalculation overhead, the array multiplication in XLOOKUP is handled efficiently by Excel's engine. It reduces file size and complexity, making it superior for large datasets despite the slight initial learning curve.

What happens if no match is found?

By default, XLOOKUP returns #N/A. You can provide a custom error message as the third optional argument. For example, adding "Not Found" after the return range will display that text instead of the error code if neither criterion matches simultaneously.

Does this work in older versions of Excel?

No, XLOOKUP is only available in Microsoft 365, Excel 2021, and Excel for the web. For older versions, you must use an INDEX/MATCH combination with concatenated keys or SUMPRODUCT, which are more verbose and prone to array entry errors.

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