IfError

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,926
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
In column A, I have these values:

Code:
1
#N/A
#N/A
0
5

In column B, I type:

Code:
=IF(A2=0,"Zero",IFERROR(A2,"Zero"))

I expected for those rows that contain an error to return "Zero" but it returns #N/A.

Why is that?

Thanks
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
You could do it like this but you have nothing for if A2 is not equal to 0 or an error:

=IFERROR(IF(A2=0,"Zero",""),"Zero")
 
Upvote 0
are the values in column A ... formulas? values you typed in?

because the way you have it now, this might work

=IF(OR(A2=0,A2="#N/A"),"Zero","")
 
Upvote 0
Thanks for the suggestion.

The values in column A are NOT formulae.
 
Upvote 0
Yeah if you type #N/A Excel reads that as text. It doesn't know (at least to my knowledge) that you are meaning "error" by typing that in there. So in order to handle a situation where you type it in like the current one, you need to handle it as if you typed text in there. So the formula i mentioned above should work.
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,164
Members
453,021
Latest member
Justyna P

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