Help Modifying a Formula - eliminate #DIV/0! result

easybpw

Active Member
Joined
Sep 30, 2003
Messages
437
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
Hello! Thanks in advance for all the help. This board has been great over the years. I have this formula, =SUM($B$23:$B$31)-SUM($A$19:$B$19)/COUNTBLANK($B$23:$B$31), and it works like I intended except for one small issue. If there are no blank cells when the countblank function starts the result is #DIV/0!. How can I eliminate the #DIV/0! result? I would prefer the answer to the formula to be a -0- in the cell but will accept an empty cell as well.

Thanks again!

Bill
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
If you are using Excel 2007 or later you can use the IFERROR function.

Code:
=IFERROR(SUM($B$23:$B$31)-SUM($A$19:$B$19)/COUNTBLANK($B$23:$B$31),0)

If you are using Excel 2003 look at the ISERROR function.
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,849
Members
449,096
Latest member
Erald

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