• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Microsoft Excel Tips and Tricks - Computergaga

  • Home
  • Excel Online Courses
  • Excel Functions List
  • Free Downloads
  • Blog
  • Tutorials
  • About
Home / Formulas / Case Sensitive Lookup with XLOOKUP in Excel

Case Sensitive Lookup with XLOOKUP in Excel

The XLOOKUP function in Excel does not perform a case sensitive match by default. So, the values “London”, “LONDON”, and “london” would all result in a match with the XLOOKUP function.

So, how do you perform a case sensitive XLOOKUP formula?

Let’s find out. Read on or watch the video tutorial.

XLOOKUP does not Perform an Exact Match

In this example, the XLOOKUP function is returning the first matching value for the status of each individual and the [Status] in tblRates. The corresponding [Rate] is then returned by the formula.

This XLOOKUP formula is ignoring case when matching the lookup value to the text in the lookup array. This is best demonstrated by the incorrect rate returned for “Sally” in cell D4.

XLOOKUP does not conduct a case sensitive match by default

The formula has matched the status of “Sally” to the upper case status value from tblRates. However, we require an exact match on the lower case value found in row 4 of tblRates. The correct rate returned for “Sally” should be 350.

How to Make XLOOKUP Case Sensitive?

To make a case sensitive XLOOKUP formula, we will use the EXACT function for the lookup array argument of XLOOKUP. This function will perform an exact match on the value you are searching for.

The result of the EXACT function will be TRUE or FALSE dependent upon whether an exact match has been made. So, for the lookup value in XLOOKUP, we will enter the value of TRUE. As this will be an exact match for the value returned by EXACT.

Advanced Excel Formulas book

What is the EXACT Function?

As its name implies, the EXACT function compares values exactly, including their case. It takes two arguments, which are the two text values to be compared.

=EXACT(text1, text2)

IF the two text values match exactly, EXACT returns TRUE, otherwise FALSE is returned.

XLOOKUP Case Sensitive Formula

The following XLOOKUP case sensitive formula returns the correct results.

=XLOOKUP(TRUE,EXACT([@Status],tblRates[Status]),tblRates[Rate])
XLOOKUP case sensitive formula

The rates of 350 and 310 are returned for the lower case status values of “Sally” and “Sophie” respectively. This proves that a case sensitive match was made.

This technique can be applied to the INDEX and MATCH functions in Excel when performing a case sensitive lookup formula also.

Common Mistakes when using a Case Sensitive XLOOKUP

For this case sensitive lookup to work, ensure that the TRUE entered for the lookup value is a logical value, and that it is not entered as a string i.e., “TRUE”. That is a common mistake.

Also, you cannot enter 1 for the lookup value. This will not achieve an exact match on the values returned by the EXACT function, as the function returns TRUE and FALSE values. The familiar #N/A error is returned instead.

The following image shows the array returned by EXACT in the value preview tooltip feature of Excel, and the resulting errors.

No exact match made between 1 and the array returned by EXACT

You could enter a double unary, or double negative, before the EXACT function to convert the TRUE and FALSE values to 1 and 0 respectively. But, it is probably easier just to enter TRUE for the lookup value.

Exact match on the converted TRUE and FALSE values

Wrap Up

This article demonstrated how to use the EXACT function to create a case sensitive lookup with the XLOOKUP function. The ability of the XLOOKUP function to handle arrays is what makes these techniques possible.

Check out the Excel function library to learn all about the best functions in Excel.

Related Posts:

  • N Functions in Excel thumbnail
    N Function in Excel
  • Sum formulas only in Excel
    Sum Formulas Only in Excel
  • SWITCH function feature
    Excel SWITCH Function - Nested IF Function Alternative
  • Moving average in Excel thumbnail
    Moving Average in Excel

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Recent Posts

  • Excel SWITCH Function – Nested IF Function Alternative
  • Sum Formulas Only in Excel
  • How to Calculate Age in Excel
  • Custom Sort in Excel
  • Case Sensitive Lookup with XLOOKUP in Excel
Advanced Excel Success book

Footer

Contact

[email protected]

LinkedIn Twitter YouTube

Useful Links

  • Home
  • Excel Online Courses
  • Tutorials
  • Sitemap
  • Privacy Policy
  • Jobs by Jooble

Course Topics

  • Blog
  • Charts
  • Courses
  • Dashboards
  • Downloads
  • Excel Tips
  • Formulas
  • Mail Merge
  • Office
  • PivotTables
  • Power BI
  • Power Pivot
  • Power Query
  • VBA

Join Our Mailing List

© Copyright 2009 Computergaga · All Rights Reserved ·