Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Returning Blanks with VLOOKUP.

Returning Blanks with VLOOKUP

Written by Allen Wyatt (last updated January 25, 2026)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365


When you use VLOOKUP to return a value from a data table, the function does not differentiate between blanks and zero values in what it returns. If the source value is zero, then VLOOKUP returns 0. Likewise, if the source is blank, then VLOOKUP still returns the value 0. For some purposes, this may not do—you need to know whether the cell being looked up is blank or if it really contains a 0.

There are many different solutions that could be pursued. For users of Excel 2019, Excel 2021, Excel 2024, or Excel in Microsoft 365, the best practice is to use the XLOOKUP function, which handles blank cells correctly without any workarounds. For those using earlier versions of Excel, there are several ways to work around this VLOOKUP behavior.

Use XLOOKUP Instead

If you are using a recent version of Excel, the XLOOKUP function is the recommended solution. It is more powerful and flexible than VLOOKUP and, for the purpose of this tip, it correctly returns a blank when the source cell is blank.

A standard XLOOKUP formula would look like this:

=XLOOKUP(B1,D:D,E:E)

This formula looks for the value in cell B1 within column D and returns the corresponding value from column E. Unlike VLOOKUP, if the corresponding cell in column E is empty, XLOOKUP will return an empty cell, not a zero.

Traditional Solutions for VLOOKUP

If you need to maintain compatibility with older versions of Excel, there are several ways to force VLOOKUP to return a blank when the source cell is empty.

One solution relies on the fact that even though VLOOKUP returns a 0 for a blank cell, it will correctly report the length of the source cell. If you use the LEN function on what is returned, an empty source cell results in a length of 0, while a source cell containing a 0 results in a length of 1. This means you could use the following formula:

=IF(LEN(VLOOKUP(B1,D:E,2,0))=0,"",VLOOKUP(B1,D:E,2,0))

In this case, if the length of what VLOOKUP returns is 0, then the formula returns a blank. Only if the length is not 0 is the result of the VLOOKUP returned.

There are other variations on this same concept, each testing a different characteristic of the data being referenced and then making the decision as to whether to actually look up that data. (As you can surmise, the variation you develop for your needs will depend on the "different characteristics of the data being referenced.")

Here's a variation, for example, that directly tests to see if the source is blank:

=IF(VLOOKUP(B1,D:E,2)="","",VLOOKUP(B1,D:E,2))

A common shortcut to force a blank return is to append an empty string to the end of the formula, like this:

=VLOOKUP(B1,D:E,2,0)&""

While this works, it is important to understand that this method converts all returned values—including real numbers—into text. This can cause problems in later calculations. For this reason, the IF or LEN methods are generally preferred if you need to preserve the numeric data type.

The formula can also be modified to check the source cell for multiple conditions. For instance, this variation returns a blank if the source is blank or if the source contains an error value (such as #N/A):

=IFERROR(TRIM(VLOOKUP(B1,H:H,1,FALSE)),"")

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12518) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Returning Blanks with VLOOKUP.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Generating a List of Macros

Got a workbook that has lots and lots of macros associated with it? Here's a way you can get a list of all of those ...

Discover More

Understanding Custom Chart Templates

Excel allows you to create custom chart formats that go beyond the standard formats provided in the program. These custom ...

Discover More

Printing Columns and Rows

If you want to print just the contents of a number of rows and columns, it can be challenging to get the output you want. ...

Discover More

Dive Deep into Macros! Make Excel do things you thought were impossible, discover techniques you won't find anywhere else, and create powerful automated reports. Bill Jelen and Tracy Syrstad help you instantly visualize information to make it actionable. You’ll find step-by-step instructions, real-world case studies, and 50 workbooks packed with examples and solutions. Check out Microsoft Excel 2019 VBA and Macros today!

More ExcelTips (ribbon)

Performing Integer Divisions

If you need to do a lot of work with whole numbers (integers), then you may wonder which of three functions you should ...

Discover More

Understanding the LET Function

The LET function provides an easy way to define and use variables within a formula. This tip shows you how you can start ...

Discover More

Nesting IF Worksheet Functions

The IF worksheet function is very handy to make conditional evaluations. You are not limited to a single IF comparison, ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 5 + 4?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.