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 February 5, 2026)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365


1

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.

If you are using a newer version of Excel (Excel 2021 or later), you might think that using XLOOKUP could provide a solution. It doesn't, unfortunately. Just like VLOOKUP, XLOOKUP doesn't discriminate between blanks and zero values in what it returns. The reason that VLOOKUP and XLOOKUP don't discriminate is that both functions are designed to return numeric values and a blank is not a numeric value.

This is probably a good time to mention that it can get a little confusing in talking about "blanks." Technically we are talking about three different types of data here. If a cell is empty, then it is just that—empty, meaning that it contains nothing. (I know, "empty" is not a data type. It is simply a condition of a cell.) The problem is that functions and formulas cannot return nothing, they must return something. As already mentioned, the VLOOKUP function is designed to return numeric values. The source being accessed by VLOOKUP can be evaluated and if it is empty, then a blank can be returned, but a "blank" isn't the same as "empty." A blank is a string that contains nothing, meaning it is a text value.

One evaluation 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,FALSE))=0,"",VLOOKUP(B1,D:E,2,FALSE))

In this case, if the length of what VLOOKUP returns is 0, then the formula returns a blank string. 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,FALSE)="","",VLOOKUP(B1,D:E,2,FALSE))

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,FALSE)&""

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)),"")

While these last two formulas work, it is important to understand that they convert 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 for returned numbers.

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

Printing via Macro without Messages

When you are printing a document, it is not unusual to see messages (dialog boxes) periodically. When you want the ...

Discover More

Locking Icons on the Desktop

Your desktop is supposed to be place where you can put your most-often-used program and file icons. You can spend hours ...

Discover More

Countering Compressed Columns

If you open a workbook and find that the width of some of your columns has been changed, the discovery can be ...

Discover More

Program Successfully in Excel! This guide will provide you with all the information you need to automate any task in Excel and save time and effort. Learn how to extend Excel's functionality with VBA to create solutions not possible with the standard features. Includes latest information for Excel 2024 and Microsoft 365. Check out Mastering Excel VBA Programming today!

More ExcelTips (ribbon)

Counting Displayed Cells

When you filter data, Excel displays only a portion of what is really in a worksheet. If you want to count the number of ...

Discover More

Random Numbers in a Range

Excel provides several different functions that you can use to generate random numbers. One of the most useful is the ...

Discover More

Using a Cell Value as a Worksheet Name in a Formula

Excel allows you to easily develop formulas that pull values from worksheets and workbooks other than the one in which ...

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 two minus 0?

2026-02-01 10:52:03

J. Woolley

The Tip's 2nd formula
    =IF(VLOOKUP(B1, D:E, FALSE)="", "", VLOOKUP(B1, D:E, FALSE))
is probably supposed to be
    =IF(VLOOKUP(B1, D:E, 2, FALSE)="", "", VLOOKUP(B1, D:E, 2, FALSE))
This can be simplified by using one of the following two Excel 2021 formulas:
    =LET(x, VLOOKUP(B1, D:E, 2, FALSE), IF(x="", "", x))
    =LET(x, XLOOKUP(B1, D:D, E:E), IF(x="", "", x))
The Tip's 3rd formula
    =VLOOKUP(B1,D:E,2,FALSE)&""
returns text. Here's another text formula
    =TRIM(VLOOKUP(B1, D:E, 2, FALSE))
The Tip's 4th formula
    =IFERROR(TRIM(VLOOKUP(B1, H:H, 1, FALSE)), "")
is perhaps supposed to be
    =IFERROR(TRIM(VLOOKUP(B1, D:E, 2, FALSE)), "")
The most likely error results if B1 is not found in column D, so here's a comparable Excel 2021 text formula:
    =TRIM(XLOOKUP(B1, D:D, E:E, ""))
But this Excel 2021 formula handles the error and doesn't force a text result:
    =LET(x, XLOOKUP(B1, D:D, E:E, ""), IF(x="", "", x))


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.