Using IFERROR & ISBLANK in same formula

rnomis

New Member
Joined
Mar 14, 2005
Messages
22
I am trying to carry out a calculation on 2 columns D and M. All formulas need to be copied down beyond the end of the data as it uses dynamic data in another sheet which can fill more rows as required. Sometimes cells in D and M are blank so I need to insert a zero. I have this formula:

=IF(ISBLANK(M10),0,D10/M10)

This produces the right result except where as sometimes happens D10/M10 results in #DIV/0! In this case it should ignore the error and insert a zero. Also sometime D and M need to stay blank when there is data in column A.

I tried:

=IFERROR(IF(ISBLANK(M10),0,D10/M10))

This inserts the zero when D and M are empty but inserts a blank cell where there should be #DIV/0!

What I need is:
If either D10 or M10 are empty, it returns 0 unless A10 is also empty
if D10/M10 would return #DIV/0! it returns a 0

I hope someone can help me combine the two expressions.

Thanks in advance
Simon
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Just great! Solved my problem in 10 minutes after I had been scratching my head for 2 hours!
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,668
Members
449,463
Latest member
Jojomen56

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