2 array countifs

jimblimm

Board Regular
Joined
May 11, 2012
Messages
219
is there any way to make this formula work

=COUNTIFS('MAIN DATA'!$BT$20:$BV$4000,A11,'MAIN DATA'!$K$20:$K$4000,"b11"))


i keep getting a value error

if i split the countifs it works.

COUNTIFS('MAIN DATA'!$BT$20:$BV$4000,A11

COUNTIFS(MAIN DATA'!$K$20:$K$4000,"b11"
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Maybe:

=COUNTIFS('MAIN DATA'!$BT$20:$BT$4000,A11,'MAIN DATA'!$BU$20:$BU$4000,A11,'MAIN DATA'!$BV$20:$BV$4000,A11,'MAIN DATA'!$K$20:$K$4000,"b11"))?

Though I don't think that will give you the results you want:

So maybe really:

=SUMPRODUCT(--(('MAIN DATA'!$BT$20:$BT$4000=A11)+('MAIN DATA'!$BU$20:$BU$4000=A11)+('MAIN DATA'!$BV$20:$BV$4000=A11)),--('MAIN DATA'!$K$20:$K$4000,"b11"))
 
Last edited:
Upvote 0
is there any way to make this formula work

=COUNTIFS('MAIN DATA'!$BT$20:$BV$4000,A11,'MAIN DATA'!$K$20:$K$4000,"b11"))


i keep getting a value error

if i split the countifs it works.

COUNTIFS('MAIN DATA'!$BT$20:$BV$4000,A11

COUNTIFS(MAIN DATA'!$K$20:$K$4000,"b11"
Is "b11" a cell reference or is it a literal string?

COUNTIFS will only work on 1 dimensional arrays.

You can use SUMPRODUCT.

=SUMPRODUCT(('MAIN DATA'!$BT$20:$BV$4000=A11)*('MAIN DATA'!$K$20:$K$4000=B11))
 
Upvote 0
nope, because if say for instance im looking for 21 in array bt:bv, your formula will return negative if all ranges dont meet the criteria, bt:bt and bu:bu

for instance bt could have 21

and bu does not, it will never count

i need it to look for if bt:bv= 21 it should count it whether its in bt:bt bu:bu bv:bv /hence bt:bv
 
Upvote 0
nope, because if say for instance im looking for 21 in array bt:bv, your formula will return negative if all ranges dont meet the criteria, bt:bt and bu:bu

for instance bt could have 21

and bu does not, it will never count

i need it to look for if bt:bv= 21 it should count it whether its in bt:bt bu:bu bv:bv /hence bt:bv

See my adjusted post in #2 using SUMPRODUCT. The "+" acts like an OR statement in SUMPRODUCT (I believe I learned that from T.Valko on this board).
 
Upvote 0
example:
k:k
s
d
r
t
s
s
d


bt:bt
11
12
14
16
15

bu:bu

14
14
15
12
22

bv:bv
14
18
98
78
54

=SUMPRODUCT(--(('MAIN DATA'!$BT$20:$BT$26=A11)+('MAIN DATA'!$BU$20:$BU$26=A11)+('MAIN DATA'!$BV$20:$BV$26=A11)),--('MAIN DATA'!$K$20:$K$26=B11))

Where I assumed "s" for B11 and 14 for A11. Formula result is 2
 
Upvote 0
example:
k:k
s
d
r
t
s
s
d


bt:bt
11
12
14
16
15

bu:bu

14
14
15
12
22

bv:bv
14
18
98
78
54
Here's the data you posted:

Book1
*KBTBUBV
1s111414
2d121418
3r141598
4t161278
5s152254
6s___
7d___
Sheet1

What are you wanting to count and what result do you expect?
 
Last edited:
Upvote 0
countifs(K:k=s, and bt:bv=14 going by the chart my answer would be 1.

even though the 14 appeared in bu:bu and bv:bv the formula would kinda be like an (or) for the BT:BV

like countifs(k:k, (bt:bt=14,or bu:bu=14 or bv:bv=14)
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,967
Members
452,371
Latest member
Frana

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