Formula returning unexpected result

ddub25

Well-known Member
Joined
Jan 11, 2007
Messages
625
Office Version
  1. 2019
Platform
  1. Windows
=IF(AO780=0,0,((AA780*AQ780)/AO780)*AP780)

I want the above forumla to return '0' IF AO780=0.

AO780 does = 0, but I am getting '#DIV/0!'

Why is this?

Dan
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Sounds like AO780 doesn't actually = 0

Could be a rounding issue..look in the formula bar for AO780, does it also show 0?

could also be that AO780 is a "number stored as text"

=ISNUMBER(AO780)
What does that return?
 
Upvote 0
Works fine for me. What about:
Code:
=IF(AO780<>0,(AA780*AQ780*AP780)/AO780,0)
jonmo's suggestion probably more likely to reveal where the error is
 
Upvote 0
It's not going to be a rounding issue though...after more thought...
If it was a rounding issue, and the cell was actually 0.0001 or whatever...
Then it wouldn't be returning #DIV/0!


But it's likely the "number stored as text" problem.
 
Upvote 0
Building on that, maybe you could try:
Code:
=IF((AO780+0)=0,0,(AA780*AQ780*AP780)/(AO780+0))
That should force AO780 to be a numerical value if it is indeed text..
 
Upvote 0
AO780 is formatted as a number.

When I try '=ISNUMBER(AO780)' FALSE is returned

AO780 contains:

=IFERROR(INDEX('[Poten. SU&Mon_MAS_110628.xlsx]Ref'!$BX$5:$BX$1130,MATCH(1,IF('[Poten. SU&Mon_MAS_110628.xlsx]Ref'!$BV$5:$BV$1130=B780,IF('[Poten. SU&Mon_MAS_110628.xlsx]Ref'!$BW$5:$BW$1130=I780,1)),0)),"0")

The formula is referencing a value on another worksheet that you helped me with earlier Jonmo.
 
Upvote 0
Try the second formula I suggested; it forces AO780 to be a numerical value by adding '0' to whatever it contains. You can test that by trying:
Code:
=ISNUMBER(AO780+0)
 
Upvote 0
Thanks Jonmo, that solved it. Thanks Jack. I tried yours but could not get it to work.

Dan
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,282
Members
452,902
Latest member
Knuddeluff

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