Share via

Formula to return error text when value not found in lookup table

Anonymous
2010-08-26T20:54:07+00:00

I am using a lookup formula to look up prices for services in a table. I need it to return error message text when a service name in column I doesn't exist in the Rates lookup table. Right now, it is returning the next highest value.

=VLOOKUP(I2,Rates!$A$2:$C$18,3)

Thanks, KM

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2010-08-26T21:03:33+00:00

I am using a lookup formula to look up prices for services in a table. I need it to return error message text when a service name in column I doesn't exist in the Rates lookup table. Right now, it is returning the next highest value.

=VLOOKUP(I2,Rates!$A$2:$C$18,3)

Thanks, KM

Why don't you set the 4th argument, range_lookup, to FALSE or 0?

=VLOOKUP(I2,Rates!$A$2:$C$18,3,0)

Using this syntax, if the lookup_value I2 is not found in Rates!A2:A18 then the formula will return the #N/A error.

If you would rather not get the #N/A error and would like some other message instead, then try something like this:

=IFERROR(VLOOKUP(I2,Rates!$A$2:$C$18,3,0),"Not Found")

Replace Not Found with a message of your choice.

--

Biff

Microsoft Excel MVP

Was this answer helpful?

3 people found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2010-08-26T21:21:26+00:00

    I knew it was something simple. My brain's just dead. Thanks!

    You're welcome. Thanks for the feedback!

    --

    Biff

    Microsoft Excel MVP

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2010-08-26T21:12:42+00:00

    I knew it was something simple. My brain's just dead. Thanks!

    Was this answer helpful?

    0 comments No comments