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

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

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

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,167,531
Messages
5,854,284
Members
431,636
Latest member
shabbas313

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