Adjusting a formula

datadummy

Active Member
Joined
Mar 16, 2017
Messages
312
Office Version
  1. 365
Platform
  1. Windows
I currently am utilizing the formula below to get percent of compliance where the entries in column E were either "Y" or "N", but now need to tweak my formula as some of the entries in column E are now "NA". What I would like to accomplish is taking those responses of "NA" and removing them from the equation.

=IFERROR(SUM(COUNTIFS(Data!A:A,">10/25/2020",Data!A:A,"<10/31/2020",Data!C:C,"AB",Data!E:E,{"Y"}))/COUNTIFS(Data!C:C,"AB",Data!A:A,">10/25/2020",Data!A:A,"<10/31/2020"),"NA")
 
you want to count the number of Y divide by the number of Y & N

I think the error is div by zero error - is that what the
COUNTIFS(Data!C:C,"Maternal Child",Data!A:A,">10/25/2020",Data!A:A,"<10/31/2020")
returns ?
a zero with na entered

sorry , this is taking a while to resolve difficult without the spreadsheet or posted using XL2BB
or a link to dropbox/onedrive

=IFERROR(SUM(COUNTIFS(Data!A:A,">10/25/2020",Data!A:A,"<10/31/2020",Data!C:C,"Maternal Child",Data!E:E,{"Y"}))/SUM(COUNTIFS(Data!C:C,"Maternal Child",Data!A:A,">10/25/2020",Data!A:A,"<10/31/2020",data!EE, {"Y","N"}),"NA")
this is just dividing by the count of the Y and N
you want to count the number of Y divide by the number of Y & N

I think the error is div by zero error - is that what the
COUNTIFS(Data!C:C,"Maternal Child",Data!A:A,">10/25/2020",Data!A:A,"<10/31/2020")
returns ?
a zero with na entered

sorry , this is taking a while to resolve difficult without the spreadsheet or posted using XL2BB
or a link to dropbox/onedrive

=IFERROR(SUM(COUNTIFS(Data!A:A,">10/25/2020",Data!A:A,"<10/31/2020",Data!C:C,"Maternal Child",Data!E:E,{"Y"}))/SUM(COUNTIFS(Data!C:C,"Maternal Child",Data!A:A,">10/25/2020",Data!A:A,"<10/31/2020",data!EE, {"Y","N"}),"NA")
this is just dividing by the count of the Y and N
I updated my formula and now excel is saying that I am missing an opening or closing parenthesis and I have no clue where. Here is the formula I entered.

=IFERROR(SUM(COUNTIFS(Data!A:A,">10/25/2020",Data!A:A,"<10/31/2020",Data!C:C,"Maternal Child",Data!E:E,{"Y"}))/SUM(COUNTIFS(Data!C:C,"Maternal Child",Data!A:A,">10/25/2020",Data!A:A,"<10/31/2020",Data!E:E,{"Y","N"}),"NA")
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
i need to see a sample of the data , not really sure what is going on

i just tried to setup a spreadsheet , BUT not really sure what is going on as i only get a 0 or NA with the formula
BUT it looks like you are trying to work out a percent of Y in column E based on the total Y and N in column E, based on a date range and AB in another column
But I dont seem to get that
 
Last edited:
Upvote 0
I have attached an image of my test entry. Here is the current formula that is stating that I am missing an opening or closing parenthesis.

=IFERROR(SUM(COUNTIFS(Data!A:A,">10/25/2020",Data!A:A,"<10/31/2020",Data!C:C,"Maternal Child",Data!E:E,{"Y"}))/SUM(COUNTIFS(Data!C:C,"Maternal Child",Data!A:A,">10/25/2020",Data!A:A,"<10/31/2020",Data!E:E,{"Y","N"}),"NA")
 

Attachments

  • Capture.GIF
    Capture.GIF
    14.5 KB · Views: 3
Upvote 0
OK so this works ignoring NA in E and gives correct % 0.5 ignoring NA and 0.3 with NA

= COUNTIFS(Data!A:A,">25/10/2020",Data!A:A,"<31/10/2020",Data!C:C, "AB",Data!E:E, "Y")/SUM(COUNTIFS(Data!A:A,">25/10/2020",Data!A:A,"<31/10/2020",Data!C:C, "AB",Data!E:E,{"Y","N"}))

Book2
GHIJ
1COUNT YCOUNT E% E NA% E Y/N
2130.333333330.5
Sheet1
Cell Formulas
RangeFormula
G2G2= COUNTIFS(Data!A:A,">25/10/2020",Data!A:A,"<31/10/2020",Data!C:C, "AB",Data!E:E, "Y")
H2H2= COUNTIFS(Data!A:A,">25/10/2020",Data!A:A,"<31/10/2020",Data!C:C, "AB")
I2I2= COUNTIFS(Data!A:A,">25/10/2020",Data!A:A,"<31/10/2020",Data!C:C, "AB",Data!E:E, "Y")/COUNTIFS(Data!A:A,">25/10/2020",Data!A:A,"<31/10/2020",Data!C:C, "AB")
J2J2= COUNTIFS(Data!A:A,">25/10/2020",Data!A:A,"<31/10/2020",Data!C:C, "AB",Data!E:E, "Y")/SUM(COUNTIFS(Data!A:A,">25/10/2020",Data!A:A,"<31/10/2020",Data!C:C, "AB",Data!E:E,{"Y","N"}))


DATA SHEET
Book2
ABCDE
2
310/26/20ABY
4Y
510/27/20ABN
610/28/20abNA
Data
 
Upvote 0
need another ) after the {"Y","N"}

=IFERROR(SUM(COUNTIFS(Data!A:A,">10/25/2020",Data!A:A,"<10/31/2020",Data!C:C,"Maternal Child",Data!E:E,{"Y"}))/SUM(COUNTIFS(Data!C:C,"Maternal Child",Data!A:A,">10/25/2020",Data!A:A,"<10/31/2020",Data!E:E,{"Y","N"})),"NA")
 
Upvote 0
need another ) after the {"Y","N"}

=IFERROR(SUM(COUNTIFS(Data!A:A,">10/25/2020",Data!A:A,"<10/31/2020",Data!C:C,"Maternal Child",Data!E:E,{"Y"}))/SUM(COUNTIFS(Data!C:C,"Maternal Child",Data!A:A,">10/25/2020",Data!A:A,"<10/31/2020",Data!E:E,{"Y","N"})),"NA")
SUCCESS!!! Thank you for dredging through this with me, I truly appreciate your patience!!
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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