# Iferror + if formula

#### drluke

##### Active Member
I am calculating the % change between unit sales year-on-year, but if the movement is greater than 500% either way I don't want the formula to do anything, and similarly if there are no figures to compare in prior years then I don't want the formula to return an error (because of division by 0). So far I have come up with:

=IFERROR(IF(D3/C3>5,"",D3/C3),"-") It seems to work ok for movements greater than 500%, but

How do I add the 'smaller than -500%' part to the formula? or
Can I use a different more effective formula instead?

### Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

#### AlanY

##### Well-known Member
try

=IFERROR(IF(abs(D3/C3)>5,"",D3/C3),"-")

#### drluke

##### Active Member
I changed my formula to the one that was suggested, and it works well except for some calculations where the result is more than 1000% either way.
Any ideas how I can change the formula to cover this scenario?

#### AlanY

##### Well-known Member
the formula exclude results over 500% that should include 1000%, have I missed something?

#### drluke

##### Active Member
Maybe I've missed something!
I have these 2 calculations as examples:

 1 B C D 2 25,555 -1,408 -1915% 3 -6,381 -275 2223%

<tbody>
</tbody>

The formulas at both D2 and D3 are

=IFERROR(IF(ABS(B2-C2)/C2>5,"",(B2-C2)/C2),"-") and
=IFERROR(IF(ABS(B3-C3)/C3>5,"",(B3-C3)/C3),"-")

#### AlanY

##### Well-known Member
try

=IFERROR(IF(ABS((B2-C2)/C2)>5,"",(B2-C2)/C2),"-")

Replies
4
Views
94
Replies
3
Views
108
Replies
4
Views
144
Replies
12
Views
236
Replies
3
Views
55

Threads
1,171,829
Messages
5,877,790
Members
433,287
Latest member
amna_shahbaz

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

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