Help fixing a formula

datadummy

Active Member
Joined
Mar 16, 2017
Messages
313
Office Version
  1. 365
Platform
  1. Windows
I am trying to fix a formula and am not having any luck, here is my current formula that is returning #Div/0!,

=SUM(COUNTIFS(June!E:E,{"FBC","Maternal Child"},June!AV:AV,{"Patient is a retired MD, and has a good understanding of his course of care.","No concerns at this time.","Nursing staff is excellent.","Spoke to son as patient has dementia."}))/SUM(COUNTIFS(June!E:E,{"FBC","Maternal Child"},June!AV:AV,"?*"))

Not sure where my error is...
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
You are trying to divide by zero.
So that means that this part is equal to zero in some cases:
SUM(COUNTIFS(June!E:E,{"FBC","Maternal Child"},June!AV:AV,"?*"))

So, you can either first check to see if that part is zero like this:
=IF(
SUM(COUNTIFS(June!E:E,{"FBC","Maternal Child"},June!AV:AV,"?*"))=0,"",SUM(COUNTIFS(June!E:E,{"FBC","Maternal Child"},June!AV:AV,{"Patient is a retired MD, and has a good understanding of his course of care.","No concerns at this time.","Nursing staff is excellent.","Spoke to son as patient has dementia."}))/SUM(COUNTIFS(June!E:E,{"FBC","Maternal Child"},June!AV:AV,"?*")))

or you can use IFERROR, i.e.
=IFERROR(SUM(COUNTIFS(June!E:E,{"FBC","Maternal Child"},June!AV:AV,{"Patient is a retired MD, and has a good understanding of his course of care.","No concerns at this time.","Nursing staff is excellent.","Spoke to son as patient has dementia."}))/SUM(COUNTIFS(June!E:E,{"FBC","Maternal Child"},June!AV:AV,"?*")),"")
 
Last edited:
Upvote 0
That worked but now I am being asked to turn the formula around and count column E "Heart Center" subtracted by any text that is in column AV and divide that by Column E "Heart Center". Ay thoughts?
 
Upvote 0
I haven't analyzed your original equation to understand exactly what it is that you are trying to do (and you didn't say what it is actually doing).
But, in the equations I provided, if you need it to return 0 instead of nothing so that it can be used in mathematical equations, then replace the instances of "" with 0.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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