1

I want to count all the instances that "a" occurs in column a AND "b" occurs in both column b and c. This would be in a match up style. Essentially I am trying to count a head to head where a occurs in column a every time b occurs in the remaining columns

The formula I used is =COUNTIFS(A1:A4,"=a",B1:C4,"=b"). This returns a "#VALUE" error.

I am aware that I could use multiple COUNTIFS but for the real workbook "b" would be spread across 20 columns so this would result in a very long and slow formula. enter image description here

3
  • 2
    So in this instance your desired result is zero?
    – JvdV
    Commented May 13, 2022 at 9:22
  • 1
    You may need MMULT(). What is your excel version?
    – Harun24hr
    Commented May 13, 2022 at 10:04
  • 2
    Maybe something like =SUMPRODUCT(--(A1:A4&B1:B4&C1:C4="abb"))? Commented May 13, 2022 at 11:20

2 Answers 2

3

One option:

enter image description here

Formula in E1:

=SUM(--(BYROW(A1:C4,LAMBDA(a,CONCAT(UNIQUE(a,1))))="ab"))
3

Here is another option,

Formula_Solution

• Formula used in cell D1

=SUMPRODUCT(MMULT(--($A$1:$B$4="a")*($B$1:$C$4="b"),{1;1}))

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.