COUNTIFS ARRAY VALUES

LawNapier

New Member
Joined
May 18, 2020
Messages
26
Office Version
  1. 365
Platform
  1. Windows
I am trying to build a formula where the below values are pulled from a table where......SUPPORT = A1 WINTEL = A2 CITRIX = A3. The only way I can get the formula to work is to list out the value string as indicated below in purple. If I ever want to change the value string, I would like to change it in the table and not in the formula. Anyone know how to modify my formula to reference the corresponding cell numbers in the table?

A
-------------
1 SUPPORT
2 WINTEL
3 CITRIX


=SUM(COUNTIFS(
'RAW DATA'!$E:$E,{"SUPPORT","WINTEL","CITRIX"},
'RAW DATA'!$K:$K,"INC",
'RAW DATA'!$M:$M,"JAN",
'RAW DATA'!$N:$N,"2019"))
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
=SUM(COUNTIFS(
'RAW DATA'!$E:$E,A1:A3,
'RAW DATA'!$K:$K,"INC",
'RAW DATA'!$M:$M,"JAN",
'RAW DATA'!$N:$N,"2019"))

Just replace the constant with range A1:A3, and press CTRL+SHIFT+ENTER for the array formula, no just press ENTER finish.
 
Upvote 0
Here are a couple of options for you to consider.

=SUM(COUNTIFS ('RAW DATA'!$E:$E,A1,
'RAW DATA'!$K:$K,"INC",
'RAW DATA'!$M:$M,"JAN",
'RAW DATA'!$N:$N,"2019"),
CONTAR.SI.CONJUNTO('RAW DATA'!$E:$E,A2,
'RAW DATA'!$K:$K,"INC",
'RAW DATA'!$M:$M,"JAN",
'RAW DATA'!$N:$N,"2019"),
CONTAR.SI.CONJUNTO('RAW DATA'!$E:$E,A3,
'RAW DATA'!$K:$K,"INC",
'RAW DATA'!$M:$M,"JAN",
'RAW DATA'!$N:$N,"2019"))


=SUMPRODUCT((((('RAW DATA'!$E2:$E10=A1)+('RAW DATA'!$E2:$E10=A2)+('RAW DATA'!$E2:$E10=A3))*
('RAW DATA'!$K2:$K10="INC")*
('RAW DATA'!$M2:$M10="JAN")*
('RAW DATA'!$N2:$N10=2019)*FILA(E2:E10))>0)+0)
 
Upvote 0
=SUM(COUNTIFS(
'RAW DATA'!$E:$E,A1:A3,
'RAW DATA'!$K:$K,"INC",
'RAW DATA'!$M:$M,"JAN",
'RAW DATA'!$N:$N,"2019"))

Just replace the constant with range A1:A3, and press CTRL+SHIFT+ENTER for the array formula, no just press ENTER finish.

shaowu459 -- That doesn't work unfortunately, but thanks for the suggestion.
 
Upvote 0
Here are a couple of options for you to consider.

=SUM(COUNTIFS ('RAW DATA'!$E:$E,A1,
'RAW DATA'!$K:$K,"INC",
'RAW DATA'!$M:$M,"JAN",
'RAW DATA'!$N:$N,"2019"),
CONTAR.SI.CONJUNTO('RAW DATA'!$E:$E,A2,
'RAW DATA'!$K:$K,"INC",
'RAW DATA'!$M:$M,"JAN",
'RAW DATA'!$N:$N,"2019"),
CONTAR.SI.CONJUNTO('RAW DATA'!$E:$E,A3,
'RAW DATA'!$K:$K,"INC",
'RAW DATA'!$M:$M,"JAN",
'RAW DATA'!$N:$N,"2019"))


=SUMPRODUCT((((('RAW DATA'!$E2:$E10=A1)+('RAW DATA'!$E2:$E10=A2)+('RAW DATA'!$E2:$E10=A3))*
('RAW DATA'!$K2:$K10="INC")*
('RAW DATA'!$M2:$M10="JAN")*
('RAW DATA'!$N2:$N10=2019)*FILA(E2:E10))>0)+0)


Dante - That does the trick. Thanks for your help!
 
Upvote 0
Dante - That does the trick. Thanks for your help!
hi, the formula is right
Book1.xlsx
ABCDEFG
1AAJan13
2BBFeb2
3CCMar3
4DApr4
5EJan5
6FJun6
7AJan7
8BMar8
9CJan9
Sheet3
Cell Formulas
RangeFormula
G1G1=SUM(COUNTIFS(C:C,A1:A3,D:D,"Jan"))
Press CTRL+SHIFT+ENTER to enter array formulas.


I checked your formula again, what goes wrong is you use "2019" in the formula, you should use 2019. "2019" will be recognised as a text. change your formula to:
=SUM(COUNTIFS(
'RAW DATA'!$E:$E,A1:A3,
'RAW DATA'!$K:$K,"INC",
'RAW DATA'!$M:$M,"JAN",
'RAW DATA'!$N:$N,2019))

CTRL SHIFT ENTER you will get expected result.
Refer to post #3, if you use "2019" instead of 2019 in the formula, the formula will not return expected result too.
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,223
Members
452,620
Latest member
dsubash

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