Quick way to change #N/A and #REF to 0?

Jake_Wrestler

Board Regular
Joined
Sep 3, 2003
Messages
150
I have a worksheet that has many many formulas and some come up with #N/A or #REF. I would like to convert these to a zero value. thanks!
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Jake_Wrestler said:
I have a worksheet that has many many formulas and some come up with #N/A or #REF. I would like to convert these to a zero value. thanks!

Why are you getting a #REF! error?
 
Upvote 0
Jake_Wrestler said:
Awesome, that worked like a charm. Love that ISERROR function

Unfortunately, the ISERROR construction has some dire consequences. It masks all error messages -- many of which are important for diagnosis. It's a much better practice to remedy the errors rather than hiding them.
 
Upvote 0
If you'd post some of the formulas which generate errors, we might be able to help get rid of some of them. But Mark is right -- a blanket cover-up of error messages can sometimes hide an underlying fault with the data or with the logic of the formula.

As an example, if you are using VLOOKUP and know, going in, that there will not always be a match (exact-type) found for your target string, you can get away with something like:

=IF(ISNUMBER(MATCH"XYZ",A1:A100,0),VLOOKUP("XYZ",A1:Z100,20,0),"")
 
Upvote 0
wow, isna and isref make it much better. Thanks guys! (ps. Jon I would post it but the data is spotty, hence the #N/As. I fixed my #REFs. )
 
Upvote 0
Jake_Wrestler said:
wow, isna and isref make it much better. Thanks guys! (ps. Jon I would post it but the data is spotty, hence the #N/As. I fixed my #REFs. )

However, the formula...

=IF(ISNA(VLOOKUP(...)),0,VLOOKUP(...))

...is very inefficient since the VLOOKUP is performed twice for those requests that return a value other than #N/A!
 
Upvote 0

Forum statistics

Threads
1,215,467
Messages
6,124,984
Members
449,201
Latest member
Lunzwe73

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top