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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Just great! Solved my problem in 10 minutes after I had been scratching my head for 2 hours!
 
Upvote 0

Forum statistics

Threads
1,215,420
Messages
6,124,803
Members
449,190
Latest member
cindykay

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