COUNTIFS Dynamic Column

tobermory

New Member
Joined
Jun 4, 2012
Messages
46
Hello there,

I want to use the COUNTIFS with a dynamic columns. Assuming the below is the data set in Sheet1.

Test 1Test 2Test 3Test 4Test 5
Person 162124
Person 201307
Person 342333
Person 443434
Person 543425
Person 642434
Person 753534
Person 842536
Person 973143
Person 1044313

<tbody>
</tbody>

In Sheet 2, the 'Tests' are listed the other way around, down a column, not across a row. i.e. 'Test 1' in A2, 'Test 2' in A3, 'Test 3' in A4 etc. How do I create a dynamic COUNTIF in Column C based on lookup/index match in column B? i.e. How many 4s were there in Test 1?

012345678910
Test 1countifcountifcountifcountifcountifcountifcountifcountifcountifcountifcountif
Test 2countifcountifcountifcountifcountifcountifcountifcountifcountifcountifcountif
Test 3countifcountifcountifcountifcountifcountifcountifcountifcountifcountifcountif
Test 4countifcountifcountifcountifcountifcountifcountifcountifcountifcountifcountif
Test 5countifcountifcountifcountifcountifcountifcountifcountifcountifcountifcountif

<tbody>
</tbody>

I hope that makes sense, many thanks in advance for your answers.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hi,

In Sheet 2 cell B2 ... you can test .

Code:
=COUNTIF(OFFSET(Sheet1!$B$2:$B$11,0,ROW()-2),COLUMN()-2)

Hope this will help
 
Upvote 0
Sorry, didn't read the full post. Since you need this on Sheet2:

=COUNTIF(INDEX('Sheet1'!$B$1:$F$11,,MATCH($A2,'Sheet1'!$B$1:$F$1,0)),B$1)
 
Upvote 0
In the spirit of community contribution, if you have another column to look for in addition you'd just add another index stipulation to countif


=iferror(COUNTIFS(INDEX($E$4:$BT,,MATCH(P4,$E$3:$BT3,0)),TRue,INDEX($E$4:$BT,,MATCH($P$3,$E$3:$BT3,0)),TRue),"")
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,331
Members
449,077
Latest member
jmsotelo

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