zero cell dividing by a zero cell

Jane Collins

New Member
Joined
Jul 22, 2005
Messages
17
I am using this formula to return a count then dividing by a number cell to give a percentage. this formula does work except when the count result is zero and the dividing cell is also zero.

How can I edit my formula to show a zero instead of #DIVO! but keep the same formula to?

=COUNT(IF(Open!$B$2:$B$5000=$C136,IF(Open!$A$2:$A$5000=E$2,IF(Open!$H$2:$H$5000=$D136,Open!$H$2:$H$5000))))/E$81
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
Hi Jane

This should work:

=IF(E$81=0,0,COUNT(IF(Open!$B$2:$B$5000=$C136,IF(Open!$A$2:$A$5000=E$2,IF(Open!$H$2:$H$5000=$D136,Open!$H$2:$H$5000))))/E$81)

Confirmed with Ctrl+Shift+Enter

Best regards

Richard
 
Upvote 0

Forum statistics

Threads
1,195,650
Messages
6,010,920
Members
441,572
Latest member
keobongda8812

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
Top