Close Menu
    XLOOKUP
    • Home
    • Blogs
    • XLOOKUP
    • Excel Guide
    • Excel Formulas
    Build Formula
    XLOOKUP
    Home » XLOOKUP Match Mode Explained: Mastering Excel’s Most Powerful Lookup Feature
    Excel Guide

    XLOOKUP Match Mode Explained: Mastering Excel’s Most Powerful Lookup Feature

    adminBy adminFebruary 3, 2026Updated:February 9, 2026No Comments10 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    XLOOKUP Match Mode Explained

    XLOOKUP match mode is a critical parameter in Excel’s revolutionary XLOOKUP function that determines how the function searches for and matches your lookup value within the lookup array, offering five distinct matching behaviors ranging from exact matches to wildcard searches and even advanced regex pattern matching. This fifth argument in the XLOOKUP formula gives users unprecedented control over matching logic, allowing exact matches (default), approximate matches returning the next smaller or larger value, wildcard searches using asterisks and question marks, and as of December 2024, sophisticated regex pattern matching for complex text scenarios. Understanding match mode transforms XLOOKUP from a simple replacement for VLOOKUP into an incredibly versatile tool capable of handling virtually any lookup scenario from precise product ID searches to flexible grade calculations and advanced data pattern recognition.

    Mastering XLOOKUP match mode is essential for anyone working with data in Excel 365, Excel 2024, or Excel 2021, as this single parameter unlocks functionality that previously required multiple different functions or complex workarounds. Whether you’re building financial models that need approximate matches for tax brackets, creating inventory systems requiring exact product code matching, or analyzing survey data with partial text searches, understanding how to leverage the five match mode options—0 for exact, -1 for next smaller, 1 for next larger, 2 for wildcards, and 3 for regex—dramatically improves your spreadsheet efficiency and analytical capabilities.

    Understanding XLOOKUP Function Syntax

    Before diving into match mode specifics, it’s important to understand where match mode fits within the complete XLOOKUP function structure. The function uses the following syntax:

    =XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])

    ArgumentRequired/OptionalDescription
    lookup_valueRequiredThe value you want to find
    lookup_arrayRequiredThe range to search in
    return_arrayRequiredThe range containing values to return
    if_not_foundOptionalText to display if no match found
    match_modeOptionalHow to match (0, -1, 1, 2, or 3)
    search_modeOptionalSearch direction (1, -1, 2, or -2)

    Match mode is the fifth argument, positioned after the if_not_found parameter. This means if you want to specify match mode without using if_not_found, you must include empty commas as placeholders.

    The Five Match Mode Options

    XLOOKUP offers five distinct match mode values, each serving specific lookup scenarios. Understanding when and how to use each option is crucial for effective data analysis.

    Match ModeValueBehaviorData RequirementsCommon Use Cases
    Exact Match0Finds exact match onlyNoneProduct IDs, employee numbers, specific values
    Exact or Next Smaller-1Exact match, or next smaller if not foundSorted descendingTax brackets, commission tiers (lower bounds)
    Exact or Next Larger1Exact match, or next larger if not foundSorted ascendingShipping rates, grade cutoffs (upper bounds)
    Wildcard Match2Partial matching using * and ?NoneEmail searches, partial names, pattern matching
    Regex Match3Complex pattern matchingNoneAdvanced text patterns, data validation

    Match Mode 0: Exact Match (Default)

    Exact match is XLOOKUP’s default behavior, meaning if you omit the match_mode argument entirely, this is what you’ll get. This mode searches for a precise, character-for-character match of your lookup value in the lookup array.

    When to Use: Use exact match when you need to find specific, unique identifiers like product codes, employee IDs, invoice numbers, or any scenario where approximate matching could produce incorrect results.

    Example Scenario: Looking up product stock quantities based on product IDs.

    =XLOOKUP(“P123”, ProductID_Range, Quantity_Range, “Product not found”, 0)

    If “P123” exists in the ProductID_Range, XLOOKUP returns the corresponding quantity. If not found, it displays “Product not found” instead of the standard #N/A error.

    Important Note: Since exact match is the default, you can achieve the same result by omitting the match_mode argument entirely:

    =XLOOKUP(“P123”, ProductID_Range, Quantity_Range, “Product not found”)

    Match Mode -1: Exact Match or Next Smaller Item

    This match mode first searches for an exact match, but if none exists, it returns the value corresponding to the next smaller (lesser) item in the lookup array. This mode assumes your lookup array is sorted in descending order for optimal performance.

    When to Use: Ideal for scenarios involving lower bounds, such as tax brackets based on income, commission rates based on sales thresholds, or discount tiers based on purchase amounts.

    Example Scenario: Calculating student grades where the lookup table shows the minimum score required for each grade.

    Suppose you have this grade structure:

    • Score 90 or above = A
    • Score 80-89 = B
    • Score 70-79 = C
    • Score 60-69 = D
    • Below 60 = F
    ScoreGrade
    90A
    80B
    70C
    60D
    0F

    =XLOOKUP(98, Score_Range, Grade_Range, , -1)

    Even though 98 doesn’t exist in the score range, XLOOKUP finds the next smaller value (90) and returns the corresponding grade (A). The double comma skips the if_not_found argument.

    Critical Consideration: The lookup array should be sorted in descending order (90, 80, 70, 60, 0) for this mode to work correctly. If unsorted, you may get incorrect results that look perfectly legitimate but are wrong.

    Match Mode 1: Exact Match or Next Larger Item

    This match mode works oppositely to -1, searching first for an exact match, then returning the value corresponding to the next larger (greater) item if no exact match exists. This mode assumes your lookup array is sorted in ascending order.

    When to Use: Best for scenarios involving upper bounds or ceilings, such as shipping costs based on weight brackets, pricing tiers with maximum thresholds, or tax calculations using upper limit structures.

    Example Scenario: Applying quantity-based discounts where the table shows the maximum quantity for each discount level.

    Suppose purchases up to $50 get no discount, $51-100 get 5% off, $101-200 get 10% off, and above $200 get 15% off:

    Sales AmountDiscount
    500%
    1005%
    20010%
    99999915%

    =XLOOKUP(75, Sales_Range, Discount_Range, , 1)

    Since 75 doesn’t exist exactly, XLOOKUP finds the next larger value (100) and returns the corresponding discount (5%).

    Important: The lookup array must be sorted in ascending order (50, 100, 200, 999999) for accurate results.

    Practical Comparison: Match Mode -1 vs Match Mode 1

    AspectMatch Mode -1Match Mode 1
    Primary UseLower bounds/minimumsUpper bounds/maximums
    Sort OrderDescendingAscending
    Example Structure“90 and above gets A”“Up to 100 gets 5% discount”
    Next Match DirectionFinds next smaller valueFinds next larger value
    Common ApplicationsIncome tax brackets, grade cutoffsShipping weight tiers, volume discounts

    Match Mode 2: Wildcard Match

    Wildcard match enables partial or pattern-based matching using Excel’s standard wildcard characters: asterisk (*) for any sequence of characters and question mark (?) for any single character.

    When to Use: Perfect for searching partial names, email addresses containing specific domains, product codes with known patterns, or any scenario where you know only part of the lookup value.

    Wildcard Characters:

    • * (asterisk) – Represents any number of characters (including zero)
    • ? (question mark) – Represents exactly one character
    • ~ (tilde) – Escape character for literal asterisk or question mark

    Example Scenarios:

    Finding customers with email addresses from a specific domain:

    =XLOOKUP(“*@company.com”, Email_Range, Customer_Range, “No match”, 2)

    Finding product codes starting with “XL”:

    =XLOOKUP(“XL*”, ProductCode_Range, Description_Range, , 2)

    Finding phone numbers with a specific area code:

    =XLOOKUP(“555-???-????”, Phone_Range, Name_Range, , 2)

    Important Notes:

    • You must explicitly set match_mode to 2 for wildcards to work
    • XLOOKUP returns the first match it finds
    • Use the tilde (~) before * or ? if you want to search for the literal character rather than the wildcard

    Match Mode 3: Regex Match (Advanced Pattern Matching)

    Introduced in December 2024 for Excel 365 users, match mode 3 enables regular expression (regex) pattern matching—an incredibly powerful text matching language that allows complex pattern searches far beyond basic wildcards.

    When to Use: Ideal for advanced scenarios like validating data formats (email addresses, phone numbers, postal codes), extracting specific text patterns, handling messy data with multiple variations, or performing sophisticated text analysis.

    Example Scenario: Searching for “USA” in data where it appears inconsistently as “USA”, “United States”, “U.S.A.”, or “US”:

    =XLOOKUP(“USA|United States|U\.S\.A\.|US”, Country_Range, Data_Range, , 3)

    The vertical bar (|) means “or” in regex, allowing the formula to match any of these variations.

    Common Regex Tokens:

    TokenMeaningExample
    .Any single charactera.c matches “abc”, “a1c”, “a@c”
    *Zero or more of precedingab*c matches “ac”, “abc”, “abbc”
    +One or more of precedingab+c matches “abc”, “abbc” but not “ac”
    ?Zero or one of precedingcolou?r matches “color” and “colour”
    |OR operatorcat|dog matches “cat” or “dog”
    []Character class[aeiou] matches any vowel
    \dAny digit\d\d\d matches any 3-digit number
    ^Start of string^The matches “The” only at start
    $End of stringend$ matches “end” only at end

    Practical Example: Finding email addresses from multiple domains:

    =XLOOKUP(“.*@(gmail|yahoo|outlook)\.com”, Email_Range, Name_Range, , 3)

    This matches emails ending with @gmail.com, @yahoo.com, or @outlook.com.

    Important Considerations:

    • Regex mode is currently in preview and available only in Excel for Microsoft 365
    • Not available in Excel 2024, 2021, or earlier versions
    • Results may change as Microsoft refines this feature
    • Microsoft recommends not using in critical workbooks until generally available

    Choosing the Right Match Mode

    Your ScenarioRecommended Match ModeExample
    Need precise, specific match0 (Exact)Employee ID lookup
    Using minimum thresholds-1 (Next Smaller)Tax brackets, grade minimums
    Using maximum limits1 (Next Larger)Shipping weight limits, discount caps
    Know only part of the value2 (Wildcard)Partial email search
    Complex text patterns3 (Regex)Data validation, messy data cleanup
    General lookup without special needs0 (Default)Most everyday scenarios

    Common Mistakes and How to Avoid Them

    Mistake 1: Wrong Sort Order for Approximate Matches

    When using match_mode -1 or 1, incorrect sorting produces wrong results that appear legitimate. Always verify your lookup array is sorted correctly:

    • Match mode -1 requires descending sort (largest to smallest)
    • Match mode 1 requires ascending sort (smallest to largest)

    Mistake 2: Forgetting to Set Match Mode for Wildcards

    Wildcard characters (* and ?) only work when match_mode is explicitly set to 2. Without this, XLOOKUP treats asterisks and question marks as literal characters to match.

    Wrong: =XLOOKUP(“*@company.com”, Email_Range, Name_Range)

    Right: =XLOOKUP(“*@company.com”, Email_Range, Name_Range, , 2)

    Mistake 3: Not Using Placeholder Commas

    If you want to specify match_mode without if_not_found, you must include an empty comma as a placeholder:

    Wrong: =XLOOKUP(value, lookup, return, 2)

    Right: =XLOOKUP(value, lookup, return, , 2)

    Mistake 4: Assuming Regex Works in All Excel Versions

    Match mode 3 (regex) is only available in Excel for Microsoft 365 and is still in preview. Using it in other versions will cause errors.

    Combining Match Mode with Other XLOOKUP Features

    Match Mode + If_Not_Found

    Customize error messages while specifying match behavior:

    =XLOOKUP(“*@gmail.com”, Email_Range, Name_Range, “No Gmail users found”, 2)

    Match Mode + Search Mode

    Combine match behavior with search direction. For example, find the last occurrence using wildcard matching:

    =XLOOKUP(“Sales*”, Department_Range, Revenue_Range, , 2, -1)

    This finds the last department name starting with “Sales” by combining wildcard match (2) with reverse search (-1).

    Availability and Version Compatibility

    Excel VersionMatch Modes Available
    Excel for Microsoft 365All modes: 0, -1, 1, 2, 3 (regex in preview)
    Excel 2024Modes: 0, -1, 1, 2 (no regex)
    Excel 2021Modes: 0, -1, 1, 2 (no regex)
    Excel 2019 and earlierXLOOKUP not available
    Excel for WebAll modes including regex

    Note: XLOOKUP is not backward compatible. Workbooks containing XLOOKUP formulas will show #NAME? errors when opened in Excel 2019 or earlier versions.

    Conclusion

    XLOOKUP match mode represents a quantum leap in Excel’s lookup capabilities, providing unprecedented flexibility and control over how data searches execute. The five match modes—exact match for precision, next smaller and next larger for approximate matching in different directions, wildcards for partial text searches, and regex for complex pattern matching—cover virtually every lookup scenario you’ll encounter in data analysis. Understanding when to use each mode transforms XLOOKUP from a simple VLOOKUP replacement into a sophisticated data retrieval powerhouse that can handle everything from basic product lookups to advanced pattern recognition.

    For anyone working seriously with data in modern Excel versions, mastering XLOOKUP match mode is no longer optional—it’s essential. The ability to choose the appropriate match mode for your specific scenario, whether that’s exact matching for inventory systems, approximate matching for financial calculations, wildcard matching for flexible searches, or regex matching for complex data validation, dramatically improves spreadsheet efficiency and analytical accuracy. As Excel continues evolving with features like regex support, XLOOKUP with its flexible match modes remains at the forefront of what makes Excel the world’s most powerful spreadsheet platform for professionals who demand precision, flexibility, and control in their data analysis workflows.

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    admin
    • Website

    Related Posts

    How to Find Duplicates in Excel: 11 Easy Methods That Actually Work

    April 2, 2026

    How to Create Drop Down List in Excel: 9 Simple Steps for Beginners

    April 2, 2026

    Why Is My VLOOKUP Not Working? 11 Common Errors and Easy Fixes

    April 1, 2026
    Leave A Reply Cancel Reply

    Categories
    • Excel Formulas
    • Excel Guide
    • XLOOKUP
    Latest Posts

    How to Freeze a Row in Excel: 7 Quick Steps to Keep Headers Visible

    April 2, 2026

    How to Find Duplicates in Excel: 11 Easy Methods That Actually Work

    April 2, 2026

    How to Create Drop Down List in Excel: 9 Simple Steps for Beginners

    April 2, 2026

    XLOOKUP Returning 0 Instead of Blank: 9 Easy Fixes You Must Know

    April 1, 2026

    Why Is My VLOOKUP Not Working? 11 Common Errors and Easy Fixes

    April 1, 2026

    How to Use XLOOKUP in Excel with Two Sheets: 9 Easy Steps for Accurate Results

    April 1, 2026

    Free XLOOKUP formula generator and interactive guide for Excel users. Learn how to use XLOOKUP in Excel with step-by-step examples.
    Categories
    • Excel Formulas
    • Excel Guide
    • XLOOKUP
    Company
    • Contact Us
    • About Us
    • Privacy Policy

    How to Freeze a Row in Excel: 7 Quick Steps to Keep Headers Visible

    April 2, 2026

    How to Find Duplicates in Excel: 11 Easy Methods That Actually Work

    April 2, 2026
    © 2026 xlookup.co.uk XLOOKUP.

    Type above and press Enter to search. Press Esc to cancel.

    Powered by
    ►
    Necessary cookies enable essential site features like secure log-ins and consent preference adjustments. They do not store personal data.
    None
    ►
    Functional cookies support features like content sharing on social media, collecting feedback, and enabling third-party tools.
    None
    ►
    Analytical cookies track visitor interactions, providing insights on metrics like visitor count, bounce rate, and traffic sources.
    None
    ►
    Advertisement cookies deliver personalized ads based on your previous visits and analyze the effectiveness of ad campaigns.
    None
    ►
    Unclassified cookies are cookies that we are in the process of classifying, together with the providers of individual cookies.
    None
    Powered by