Countifs multiple criteria in a range and a column error

Uncanny_Wolf

New Member
Joined
Sep 17, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi fellow Excel friends, can someone help me figure out why this equation doesn't work:

=SUM(COUNTIFS(F5:AN99,{"Y1","Y2","M"},$C$5:$C$99,"S"))/SUM(COUNTIFS(F5:AN99,{"Y1","Y2","M","N","NR"},$C$5:$C$99,"S"))

I am trying to work out a percentage of cells that meet my criteria, so essentially want to know the number of cells that contain Y1 or Y2 etc... in the range F5:AN99 AND also have a letter S on the corrosponding row in column C.

Can anyone help me?

Many thanks
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Hi Uncanny_Wolf,

The criteria range for COUNTIFS must all be the same size so F5:AN99 can't be used with the single column $C$5:$C$99

I'm sure somebody will be along with a more elegant solution but until then I believe this will do what you ask.
NOTE: All cells not shown are empty for brevity.

Uncanny_Wolf.xlsx
ABCDEFGHI
1
2
366.67%
4
5SY1NY2
6XNMN
7SMNRM
8XNNRN
9SY2NY1
10
Sheet1
Cell Formulas
RangeFormula
F3F3=(SUMPRODUCT(--($F$5:$AN$99="Y1")*($C$5:$C$99="S"))+SUMPRODUCT(--($F$5:$AN$99="Y2")*($C$5:$C$99="S"))+SUMPRODUCT(--($F$5:$AN$99="M")*($C$5:$C$99="S")))/(SUMPRODUCT(--($F$5:$AN$99="Y1")*($C$5:$C$99="S"))+SUMPRODUCT(--($F$5:$AN$99="Y2")*($C$5:$C$99="S"))+SUMPRODUCT(--($F$5:$AN$99="M")*($C$5:$C$99="S"))+SUMPRODUCT(--($F$5:$AN$99="N")*($C$5:$C$99="S"))+SUMPRODUCT(--($F$5:$AN$99="NR")*($C$5:$C$99="S")))
 
Upvote 0
This formula might be also working for you.

Book1.xlsm
BCDEFG
30.818182
4
5
6
7
8SY1Y2
9SY1Y2
10SY1Y2
11Y1Y2
12SNNR
13NY2
14SNY2
15NY2
16SY1Y2
17
Sheet3
Cell Formulas
RangeFormula
E3E3=SUMPRODUCT(--((F8:I23="y1")+(F8:I23="y2")+(F8:I23="M"))*(C8:C23="S"))/SUMPRODUCT(--((F8:I23="y1")+(F8:I23="y2")+(F8:I23="M")+(F8:I23="N")+(F8:I23="R"))*(C8:C23="S"))
 
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,361
Members
449,080
Latest member
Armadillos

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