#DIV/O! or #N/A problems

audrey

Active Member
Joined
Jul 30, 2008
Messages
491
Hello,

it might be a simple question for most of you but, when I try to retrive data I sometimes get the following errors like

#DIV/O! or #N/A

those are apparering in case like

=HPVAL(F10, B94, F9, F7, F8) or even simplier cases like 0 minus 0 !!!

is there a way to ignore them automatically from options or an if function so that if data cannot be calculated or retrived simply fill the cell with '0'
 

Some videos you may like

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Domski

Well-known Member
Joined
Jan 18, 2005
Messages
7,292
For #N/A you can use this:

=IF(ISNA(your_formula),"",your_formula)

You can also use the more wide ranging:

=IF(ISERROR(your_formula),"",your_formula)

Be a little careful using ISERROR though as it will mask all errors in your formula.

If you have 2007 you should also look at the IFERROR function.

Dom
 

audrey

Active Member
Joined
Jul 30, 2008
Messages
491
thanks guys


@Dom

If I understood correctly, in case of an error is this formula leaves that cell blank ?

=IF(ISNA(your_formula),"",your_formula)

and in this case

=IF(ISNA(your_formula),"0",your_formula)

fills with zero ?
 

Domski

Well-known Member
Joined
Jan 18, 2005
Messages
7,292

ADVERTISEMENT

Nearly...

=IF(ISNA(your_formula),"0",your_formula)

...will put 0 in but it will be a text string. For a numeric value to be returned use:

=IF(ISNA(your_formula),0,your_formula)

Dom
 

Domski

Well-known Member
Joined
Jan 18, 2005
Messages
7,292
For #DIV/0! you really just need to test that the divisor isn't 0 like this:

=IF(B1=0,0,A1/B1)

Dom
 

Watch MrExcel Video

Forum statistics

Threads
1,127,347
Messages
5,624,136
Members
416,012
Latest member
rockermom59

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
Top