Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoiding index & match #N/A value

I am indexing column O on a match of a value with a combined name within column L.

If the combined name is not found within the table I am index/matching, I will be passed back a #N/A value. How could I avoid this? I've looked into the ISNA function however it only passes back a True or False value. I could use this to make another formula to set it, but am trying to find a shorter quicker way.

The current index/match being used is:

=INDEX(O:O,MATCH(ADIST& " " &APROD,L:L,0))

And if I am being passed back a #N/A value I'd like it to say "No Value".

like image 448
Brad Avatar asked Mar 09 '23 17:03

Brad


2 Answers

Use IFERROR to set an alternative value if the formula you are using returns an error:

=IFERROR(INDEX(O:O,MATCH(ADIST& " " &APROD,L:L,0)),"No Value")
like image 120
Jordan Avatar answered Mar 14 '23 18:03

Jordan


Use IFNA or IFERROR functions, same syntax but IFNA is more accurate on the type of error :

=IFNA(expression, value if expression returns an error)

so for you :

=IFNA(INDEX(O:O,MATCH(ADIST& " " &APROD,L:L,0)),"No Value")
like image 42
R3uK Avatar answered Mar 14 '23 20:03

R3uK