# =if(iserror

#### j4ymf

##### Well-known Member
hello

can i change this code so that if there is an error it changes it to somthing like this code
=IF(ISERROR(\$G\$17/\$H\$17),"- - -",\$G\$17/\$H\$17)

thanks jason

Code:
``=SUMPRODUCT(--(\$E\$31:\$E\$475="MABF")*(\$O\$31:\$O\$475="RED"),\$H\$31:\$H\$475)``

### Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the \$ sign).

#### martindwilson

##### Well-known Member
i cant see how you get an error anyway unless there is an error in one of the ranges
and fyi the -- is unnecessary if you are using *
=SUMPRODUCT((\$E\$31:\$E\$475="MABF")*(\$O\$31:\$O\$475="RED"),\$H\$31:\$H\$475)
or use
=SUMPRODUCT(--(\$E\$31:\$E\$475="MABF"),--(\$O\$31:\$O\$475="RED"),\$H\$31:\$H\$475)

#### j4ymf

##### Well-known Member
Hello martindwilson

the reason i get errors #N/A is some time i have empty rows and not always will my query go down to 475

thanks jason

#### martindwilson

##### Well-known Member
if you put that formula in a cell on a blank sheet you get 0 not n/a,

#### Jonmo1

##### MrExcel MVP
The basic syntax of If(Iserror is

replace calc with the calculation you want to test for an error.
replace "do this instead of error" with the value you want returned instead of the error.

The calculation you want to test for an error is
SUMPRODUCT(--(\$E\$31:\$E\$475="MABF")*(\$O\$31:\$O\$475="RED"),\$H\$31:\$H\$475)

So it becomes

If you have XL2007+ it's muich easier with IFERROR

Last edited:

Replies
2
Views
147
Replies
10
Views
137
Replies
1
Views
118
Replies
6
Views
105
Replies
0
Views
41

1,126,940
Messages
5,621,728
Members
415,853
Latest member
Newlife72

### 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.

### Which adblocker are you using?

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

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