IF(ISERROR

ozbeachbum

Board Regular
Joined
Jun 3, 2015
Messages
233
Office Version
  1. 2021
Platform
  1. Windows
I have a formula [=IF(ISERROR((B3/B4)),0,((B4-B3)/B4))] that returns the correct percentages for Columns B & F, but not D.
I need to adjust it so that results in B & F show as is and where D4 equals ZERO no matter what the amount in D3 is, the percentage for D2 would always be 100%.

EG: B 0.00% D 100.00% F 50.00%

Thanks in advance for any assistance.

241106 if error.xlsx
BCDEF
20.00%0.00%50.00%
3$ -$ 0.50$ 0.50
4$ -$ -$ 1.00
5
6100.00%
Blank
Cell Formulas
RangeFormula
B2,F2,D2B2=IF(ISERROR((B3/B4)),0,((B4-B3)/B4))
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Try this:

Book1
BCDEF
20%100%50%
3$0.50$0.50
4$1.00
Sheet1
Cell Formulas
RangeFormula
B2,F2,D2B2=IF(B4=0,IF(B3=0,0,1),(B4-B3)/B4)
 
Upvote 0
Solution
Hi Phuoc,
Thanks for your formula it works perfectly.
On entering it into the actual worksheet, I realised that there was one other situation I needed to account for, where both rows 3 & 4 have positive amounts and row 3 is greater than row 4.
Trusting that it is ok to ask if you could work it into your formula.
Cheers,
Dave.
241106 if error.xlsx
BCDEFGH
20.00%100.00%50.00%200.00%
3$ -$ 0.50$ 0.50$ 3.00
4$ -$ -$ 1.00$ 1.00
Blank
Cell Formulas
RangeFormula
B2,F2,D2B2=IF(B4=0,IF(B3=0,0,1),(B4-B3)/B4)
 
Upvote 0
What about ..

Excel Formula:
=IF(B4,ABS(B4-B3)/B4,--(B3<>""))
 
Upvote 0
Hi Peter,
Thanks as always for your suggestions.
As you can see on the mini sheet, it is giving the correct answers for D F & H, but B is not correct.

241106 if error.xlsx
BCDEFGH
2100.00%100.00%50.00%200.00%
3$ -$ 0.50$ 0.50$ 3.00
4$ -$ -$ 1.00$ 1.00
5
60.00%
Blank
Cell Formulas
RangeFormula
B2,H2,F2,D2B2=IF(B4,ABS(B4-B3)/B4,--(B3<>""))
 
Upvote 0
it is giving the correct answers for D F & H, but B is not correct.
Yes, sorry, I overlooked the currency formatting for 0
Just a small change I believe

24 11 07.xlsm
BCDEFGH
20.00%100.00%50.00%200.00%
300.50.53
40011
Sheet5
Cell Formulas
RangeFormula
B2,H2,F2,D2B2=IF(B4,ABS(B4-B3)/B4,--(B3<>0))


Maybe:
=IF(AND(B4,B4+B3),(B4-B3)/B4,--OR(B3))
Scott, that doesn't produce the correct result for column H per posts 3 & 5.
 
Upvote 0
How does it not I got 2 which is 200%


0.00%100.00%50.00%200.00%
00.50.53
0011
 
Upvote 0
How does it not I got 2 which is 200%
Don't know how you got 2 when when row 4 minus row 3 is negative, then divide by positive. :huh:
Here is my sheet with your formula

24 11 07.xlsm
ABCDEFGH
1
20.00%100.00%50.00%-200.00%
300.50.53
40011
Sheet5 (2)
Cell Formulas
RangeFormula
B2,H2,F2,D2B2=IF(AND(B4,B4+B3),(B4-B3)/B4,--OR(B3))
 
Upvote 0
OK. Then how about:
=IF(AND(B4,B4+B3),ABS((B4-B3)/B4),--OR(B3))

Book1
BCDEFGH
2100.00%100.00%50.00%200.00%
310.50.53
40011
Sheet1
Cell Formulas
RangeFormula
B2,H2,F2,D2B2=IF(AND(B4,B4+B3),ABS((B4-B3)/B4),--OR(B3))
 
Upvote 0

Forum statistics

Threads
1,223,881
Messages
6,175,159
Members
452,615
Latest member
bogeys2birdies

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