Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Returning Blanks or Asterisks from a Lookup.

# Returning Blanks or Asterisks from a Lookup

Written by Allen Wyatt (last updated May 19, 2018)
This tip applies to Excel 97, 2000, 2002, and 2003

Bob asked if there was a way to use VLOOKUP to return blanks or asterisks if the function cannot make a match in a lookup table.

Yes, this can be done, but not without making your formula just a bit more complex. The trick is to remember that VLOOKUP can operate in one of two ways. By default, it returns the next lower value to the one being looked for, if the data table is in ascending order and if there isn't an exact match. However, you can force VLOOKUP to only return exact matches, if desired. Consider the following example:

```=VLOOKUP(5,A1:B10,2,FALSE)
```

This example searches through the lookup table (A1:B10) looking for the value 5 in the first column of the table. If it is found, then the corresponding value from the second column is returned. If it is not found, then VLOOKUP returns an #N/A error, indicating it could not locate the value. (The FALSE value as the fourth parameter indicates you don't want approximate matches.)

The key, then, is to play off this #N/A value and build what you want returned if there isn't a match. The following formula will return a series of five asterisks if there wasn't a match in the lookup:

```=IF(ISNA(VLOOKUP(5,A1:B10,2,FALSE)),"*****",VLOOKUP(5,A1:B10,2,FALSE))
```

The ISNA function is used to test if the result of VLOOKUP is the #N/A error. If it is, then the asterisks are returned; if not, then the lookup value is returned. If you want the formula to return "nothing," then you can use this variation:

```=IF(ISNA(VLOOKUP(5,A1:B10,2,FALSE)),"",VLOOKUP(5,A1:B10,2,FALSE))
```

This version returns a blank string if there was not a match in the lookup table. For some uses, this may not be exactly what you want. You may find it more appropriate to return a zero, and then hide zeroes in the worksheet (Tools | Options | View tab | clear the Zero Values check box). If you'd like a zero returned, then it takes only one change:

```=IF(ISNA(VLOOKUP(5,A1:B10,2,FALSE)),0,VLOOKUP(5,A1:B10,2,FALSE))
```

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3335) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Returning Blanks or Asterisks from a Lookup.

##### 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

Speeding Up Large Worksheets

If your worksheet gets large enough, you may notice a severe slowdown when it is recalculated. This tip provides some ...

Discover More

Add subtotals to a worksheet and you can instruct Excel to start each new subtotal section on a new printed page. You may ...

Discover More

Two Printed Copies to Different Paper Trays

Many modern printers include multiple paper trays that can be used for different types or colors of paper. Word allows ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

##### More ExcelTips (menu)

Returning a Weight and a Date

If you have two columns containing dates and weights from those dates, you may want to pick a date associated with a ...

Discover More

Using the COLUMN Function

Need to know the column number for use in a formula? The worksheet function you want is the COLUMN function, described in ...

Discover More

Returning Blanks with VLOOKUP

Normally the VLOOKUP function returns a value, and if it can't return a value it returns a zero. Here's how you can use ...

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.

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 more than 9?

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 menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.