IS ERR Function Help

montanaaggie

Board Regular
Joined
Nov 11, 2005
Messages
124
Office Version
  1. 365
Platform
  1. Windows
I have values in column E and F. In G I have an equation of F/E. However I will now and then expect to receive the value #Div/0!. How can I create an IF statement that will create the calculation f/e, however if an error is found it will display 0 or "-"
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I have values in column E and F. In G I have an equation of F/E. However I will now and then expect to receive the value #Div/0!. How can I create an IF statement that will create the calculation f/e, however if an error is found it will display 0 or "-"
One way...

For a return of 0:

=IF(E1=0,0,F1/E1)
 
Upvote 0
That is one way, however there will be times depending on the data that its not due to the fact there is a zero. I know there is a way to do an if statement combined with iserror or iserr, just can't seem to get my logic to work.
 
Upvote 0
=IF(ISERR(F1/E1),0,F1/E1)

If E1 is 0, then ISERR(F1/E1) returns the logical value TRUE. The IF function calls for the first argument to be something that evaluates to either TRUE or FALSE.
 
Last edited:
Upvote 0
I can't see many (any?) circumstances where Biff's suggestion won't work but a simple ISERR version would go something like this

=IF(ISERR(F1/E1),0,F1:E1)
 
Upvote 0
Do note that there is a difference downstream between using a 0 and a dash for certain functions. Note the difference in the results of AVERAGE() and COUNT() if using Biff's solution with a zero or with a Dash.

Excel Workbook
EFGH
1530.60.6
23200
32321616
4230-
50340-
6Average3.325.533333
7Count53
Sheet1
 
Upvote 0
That is one way, however there will be times depending on the data that its not due to the fact there is a zero. I know there is a way to do an if statement combined with iserror or iserr, just can't seem to get my logic to work.

Since we are expecting a number, we can also invoke ISNUMBER which reports FALSE for anything non-numeric, including Excel's error values:

=IF(ISNUMBER(F1/E1),F1/E1,0)
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,762
Members
452,940
Latest member
rootytrip

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