Case Sensitive VLOOKUP in Google Sheets

Published on

The standard VLOOKUP function in Google Sheets is case-insensitive. However, you can perform a case-sensitive VLOOKUP in Google Sheets by combining it with helper functions like EXACT, REGEXMATCH, or CODE.

This tutorial walks you through simple, practical methods to implement case-sensitive lookups with easy-to-follow examples.

Comparison Table: Methods for Case-Sensitive VLOOKUP

MethodDescriptionUse Case
EXACT + VLOOKUPUses EXACT for strict case comparisonRecommended for simple, clean implementation
REGEXMATCH + VLOOKUPUses regex to match case-sensitive patternsGood for partial/word-boundary matching
CODE + VLOOKUPCompares character codesMore complex; rarely preferred
XLOOKUP / FILTER / INDEX-MATCHAlternatives to VLOOKUP supporting case sensitivityMore flexible and readable

Sample Data and Case-Insensitive VLOOKUP Formula

In column A, we have product IDs, column B contains corresponding descriptions, and column C shows the available quantities. We’ll use this table to demonstrate a case-sensitive VLOOKUP.

Some product IDs differ only by case. For example, SH_101A and SH_101a both refer to safety helmets from different makes.

Screenshot showing case-insensitive VLOOKUP in Google Sheets returning incorrect value due to letter case mismatch

Let’s say you want to look up a product name based on an ID entered in cell E2:

=VLOOKUP(E2, A2:C, 2, 0)

This standard formula returns the second column value that matches the search key in column A. However, since VLOOKUP is case-insensitive, it may return incorrect results when dealing with IDs that differ only in case.

To fix that, let’s explore how to use a case-sensitive VLOOKUP in Google Sheets using EXACT, REGEXMATCH, and CODE.

Case Sensitive VLOOKUP Using EXACT

The EXACT function checks whether two strings match exactly, including letter casing.

Here’s how you can use it with ArrayFormula:

=ArrayFormula(EXACT(E2, A2:A))

This returns an array of TRUE or FALSE values, depending on whether each cell in column A exactly matches E2.

EXACT function in Google Sheets returning TRUE or FALSE array for case sensitive VLOOKUP comparison

Use with VLOOKUP

You can feed this result into a virtual range using HSTACK or curly braces:

=ArrayFormula(VLOOKUP(TRUE, {EXACT(E2, A2:A), B2:C}, 2, 0))

Here, TRUE is used as the lookup value because the first column of the virtual range is now a series of TRUE/FALSE values.

Case sensitive VLOOKUP in Google Sheets using ArrayFormula with EXACT function for accurate match

Spill Formula (Multiple Search Keys)

If you have multiple search keys (for example, in E2:E4), use this MAP version:

=MAP(E2:E4, LAMBDA(r, ArrayFormula(VLOOKUP(TRUE, {EXACT(r, A2:A), B2:C}, 2, 0))))

Tip: If you’re manually copying the non-spill formula down (instead of using the MAP version), make sure to convert the ranges to absolute references — for example, change A2:A to $A$2:$A and B2:C to $B$2:$C.

Case Sensitive VLOOKUP Using REGEXMATCH

This is a similar approach using REGEXMATCH. Instead of EXACT, use:

REGEXMATCH(A2:A, "^" & E2 & "$")

This checks for an exact full-string match, respecting case.

Case-Sensitive Formula with REGEXMATCH

=ArrayFormula(VLOOKUP(TRUE, {REGEXMATCH(A2:A, "^"&E2&"$"), B2:C}, 2, 0))

Partial Match (Optional)

Want to allow partial whole-word matches? Replace the pattern with:

"\b" & E2 & "\b"

This lets “ILJ_102A Wh#2” match “ILJ_102A”.

Spill Formula for Multiple Matches

=MAP(E2:E4, LAMBDA(r, ArrayFormula(VLOOKUP(TRUE, {REGEXMATCH(A2:A, "^"&r&"$"), B2:C}, 2, 0))))

Case Sensitive VLOOKUP Using CODE

This method is less flexible but helpful to understand, especially when reviewing shared sheets.

Since CODE only returns the Unicode value of the first character, we use MID and SEQUENCE to convert each character and concatenate the results.

Step 1: Add a Helper Column

In cell D2, enter:

=ArrayFormula(JOIN("", CODE(MID(A2, SEQUENCE(LEN(A2)), 1))))
Google Sheets CODE function example showing Unicode values of each character for case comparison

Drag it down as needed.

Step 2: VLOOKUP with CODE

Now convert the search key directly within the following formula (no helper column needed for it):

=VLOOKUP(ArrayFormula(JOIN("", CODE(MID(E2, SEQUENCE(LEN(E2)), 1)))), {D2:D, B2:C}, 2, 0)

Because of the complexity and helper column requirement, I don’t recommend this method for most use cases.

Alternatives to Case Sensitive VLOOKUP in Google Sheets

If you prefer not to use VLOOKUP, these formulas also support case-sensitive lookups in Google Sheets:

XLOOKUP:

=ArrayFormula(XLOOKUP(TRUE, EXACT(E2, A2:A), B2:B))

FILTER:

=FILTER(B2:B, EXACT(E2, A2:A))

INDEX + MATCH:

=INDEX(B2:B, MATCH(TRUE, EXACT(E2, A2:A), 0))

These methods offer flexible, readable, and often more efficient alternatives to case-sensitive VLOOKUP formulas.

Resources

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Expert Prashanth KV is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

Top Discussions

More like this

Pivot Table Formatting, Output & Special Behavior in Google Sheets

Pivot Tables in Google Sheets are powerful—but they can get tricky once you move...

Pivot Table Calculations & Advanced Metrics in Google Sheets

When it comes to built-in tools for data analysis and visualization in Google Sheets,...

Google Sheets Pivot Table Tutorial: Basics, Setup, and Date Grouping

The easiest way to summarize, analyze, and report data in Google Sheets is by...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.