Jebak dan tangani kesalahan #N/A
=IFNA(value, value_if_na)
| Parameter | Deskripsi |
|---|---|
value |
The value, reference, or formula to check for an error. |
value_if_na |
The value to return if #N/A error is found. |
For example, in the worksheet shown, we are using VLOOKUP to find an item's price in the range B5:C16. The formula in F5, copied down, looks like this
=VLOOKUP(E5,$B$5:$C$16,2,FALSE)
To use the IFNA function to trap #N/A errors, embed the original formula inside IFNA as the first argument. In this case, we start off with the IFNA f
=IFNA(
Then we paste in the original formula like so:
=IFNA(VLOOKUP(H5,$B$5:$C$16,2,FALSE),
Next, provide an alternative result as the second argument. In the worksheet shown, we provide an empty string ("") so that the #N/A error is effectiv
=IFNA(VLOOKUP(H5,$B$5:$C$16,2,FALSE),"")
Notice that the result in cells I5, I6, and I7 is unaffected; VLOOKUP returns the item price as before. However, in cell I8, we now see a blank cell.
=IFNA(VLOOKUP(H5,$B$5:$C$16,2,FALSE),"Not found")
Like the IFNA function, the IFERROR function is designed to manage errors. In the worksheet shown, we can use IFERROR instead of IFNA like this:
=IFERROR(VLOOKUP(H8,$B$5:$C$16,2,FALSE),"")