Information Technology
Information Technology

Reputation: 2333

How to deal with an error condition like missing or bad lookup_value with Excel MATCH and INDEX formulas?

I have the following data and I'm feeding the results of a Match formula into an Index formula to find a matching value.

enter image description here

When a cell has missing data or data that does not lead to a good resulting value, I get a "#N/A" value.

How would I modify the formula =INDEX(A:A,MATCH(C7,B:B,0)) to put a string like "NO_DATA" in a cell where such situations happen? {In other words, I'd like to see "NO_DATA" instead of "#N/A"}.

Upvotes: 1

Views: 29

Answers (1)

BenShelton
BenShelton

Reputation: 911

Just wrap an IFERROR around it

=IFERROR(INDEX(A:A,MATCH(C7,B:B,0)),"NO_DATA")

Upvotes: 5

Related Questions