Countif with Index-Match

Jasesair

Active Member
Joined
Apr 8, 2015
Messages
282
Office Version
  1. 2016
I have some mocked up data below. I'm not sure how but I'm wanting to lookup James in column B and count how many values there are for James...but only count the first # columns based on A1. In the below case, A1 is 4 so the formula would count from cells C5:F5. Result for James would be 1. If looking up John, the result would be 3.

Can anyone assist please? Hopefully I've explained properly.

Excel Help.png
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Heres a couple:

=COUNT(INDEX($C$3:$C$6,MATCH("James",$B$3:$B$6,0)):INDEX($C$3:$M$6,MATCH("James",$B$3:$B$6,0),$A$1))
=COUNT(OFFSET($B$2,MATCH("James",$B$3:$B$6,0),1,1,$A$1))

Both end up doing the same thing.
 
Upvote 0
Solution

Forum statistics

Threads
1,215,487
Messages
6,125,086
Members
449,206
Latest member
ralemanygarcia

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