Counting multiple criteria in one column

datadummy

Active Member
Joined
Mar 16, 2017
Messages
312
Office Version
  1. 365
Platform
  1. Windows
I am trying to write a statement that essentially says if cells N14-N19 = either Y or NA count it as Y.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
One way:
Code:
=COUNTIF(N14:N19,"Y")+COUNTIF(N14:N19,"NA")
 
Upvote 0
Something like that



=IF(OR(COUNTIF(N14:N19,"Y")=6,COUNTIF(N14:N19,"NA")=6),"Y")
 
Upvote 0
If I wanted to take it a step further and account for those same cells and then divide them by the total number of entries in the specified cells to return a percentage what might that look like?
 
Upvote 0
Do you mean something like this?

Code:
=(COUNTIF(N14:N19,"Y")+COUNTIF(N14:N19,"NA"))/COUNTA(N14:N19)
 
Upvote 0
If I wanted to take it a step further and account for those same cells and then divide them by the total number of entries in the specified cells to return a percentage what might that look like?

You can put examples 3 or more examples of what you have in the cells and the result you expect.
 
Upvote 0
So heres what I have so far,
=COUNTIFS(ATRMC!$C:$C,">4/30/2019",ATRMC!$C:$C,"<6/1/2019",ATRMC!N:N,"Y")+COUNTIFS(ATRMC!$C:$C,">4/30/2019",ATRMC!$C:$C,"<6/1/2019",ATRMC!N:N,"NA")/COUNTIFS(ATRMC!$C:$C,">4/30/2019",ATRMC!$C:$C,"<6/1/2019")
This is returning 250% rather than 83% there's 2 Y responses and 3 NA's and 1 N.
 
Upvote 0
Mathematical order of operations usually does multiplication and division before addition and subtraction. So you need parentheses around your first two COUNTIFS:
Code:
[COLOR=#333333]=[/COLOR][COLOR=#ff0000][B]([/B][/COLOR][COLOR=#333333]COUNTIFS(ATRMC!$C:$C,">4/30/2019",ATRMC!$C:$C,"<6/1/2019",ATRMC!N:N,"Y")+COUNTIFS(ATRMC!$C:$C,">4/30/2019",ATRMC!$C:$C,"<6/1/2019",ATRMC!N:N,"NA")[/COLOR][COLOR=#ff0000][B])[/B][/COLOR][COLOR=#333333]/COUNTIFS(ATRMC!$C:$C,">4/30/2019",ATRMC!$C:$C,"<6/1/2019")[/COLOR]
 
Last edited:
Upvote 0
So heres what I have so far,
=COUNTIFS(ATRMC!$C:$C,">4/30/2019",ATRMC!$C:$C,"<6/1/2019",ATRMC!N:N,"Y")+COUNTIFS(ATRMC!$C:$C,">4/30/2019",ATRMC!$C:$C,"<6/1/2019",ATRMC!N:N,"NA")/COUNTIFS(ATRMC!$C:$C,">4/30/2019",ATRMC!$C:$C,"<6/1/2019")
This is returning 250% rather than 83% there's 2 Y responses and 3 NA's and 1 N.

Sorry, but I did not understand your examples I do not see the values ​​in the cells nor do I understand the dates.

ABCDEFGHIJKLN
1
2 Y
3 Y
4 Y
5 Y
6 N
7 N
8 N
9 N
10 Y
11 Y
12 Y
13 N
14 N

<colgroup><col span="14"></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,215,343
Messages
6,124,405
Members
449,157
Latest member
mytux

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