Countif with the changing of column values

jeffreybrown

Well-known Member
Joined
Jul 28, 2004
Messages
5,152
Seems like I've seen this before, but failing to find it.

In E2 =COUNTIF($C$2:C2,C2) to count the uniques within the category of North in column A.

With a change of category in A, East, the formula is manually updated to =COUNTIF($C$7:C7,C7) and so on.

How can this be modified to be dynamic based off of the change in category of column A?
Excel Workbook
ABCE
1Col1Col2Col3Col4
2NorthJanB001B1
3NorthJanBQM167A1
4NorthJanC005M1
5NorthFebB001B2
6NorthFebBQM167A2
7EastMarC020C1
8EastAprC020E1
9EastMayCVLSP1
10EastMayE003B1
11EastMayCVLSP2
12SouthJuneE003B1
13SouthJuneC020C1
14SouthJuneC020E1
15SouthJulyCVLSP1
16SouthJulyE003B2
17WestAugustB001B1
18WestAugustBQM167A1
19WestAugustC005M1
20WestAugustB001B2
21WestSeptemberBQM167A2
Sheet2
Excel 2007
Cell Formulas
RangeFormula
E2=COUNTIF($C$2:C2,C2)
E7=COUNTIF($C$7:C7,C7)
E12=COUNTIF($C$12:C12,C12)
E17=COUNTIF($C$17:C17,C17)
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Or, if you are pre-Excel 2007, in A2 and copy down:
Code:
=IF(A1="Col1",1,IF(A2=A1,COUNTIF(C$1:C2,C2),1))
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,135
Members
452,890
Latest member
Nikhil Ramesh

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