Count Unique If

CROY1985

Well-known Member
Joined
Sep 21, 2009
Messages
501
Office Version
  1. 365
Platform
  1. Windows
Hi all

Long time since ive posted on here!

I have a little problem and hoping some can help:

I have a list of branches (will be multiple rows per branch) and the region they sit within (North, Central or South) - branches will always be grouped together but the region might not be. And i want to number the unique branches within its region: For the purpose of this i'd like to avoid sorting the data and instead do it by formula:

So for example below i'd want to formulate the output in the 3rd column based upon the first 2 columns:


BranchRegionNumbered
1​
NorthNorth 1
2​
CentralCentral 1
2​
CentralCentral 1
3​
SouthSouth 1
4​
CentralCentral 2
5​
NorthNorth 2
6​
NorthNorth 3
6​
NorthNorth 3
7​
CentralCental 3
8​
SouthSouth 2
9​
SouthSouth 3
10​
NorthNorth 4
10​
NorthNorth 4

Any help would be hugely appreciated!

Thanks
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Maybe
+Fluff 1.xlsm
IJKL
1BranchRegionNumbered
21NorthNorth 1North 1
32CentralCentral 1Central 1
42CentralCentral 1Central 1
53SouthSouth 1South 1
64CentralCentral 2Central 2
75NorthNorth 2North 2
86NorthNorth 3North 3
96NorthNorth 3North 3
107CentralCental 3Central 3
118SouthSouth 2South 2
129SouthSouth 3South 3
1310NorthNorth 4North 4
1410NorthNorth 4North 4
Data
Cell Formulas
RangeFormula
L2:L14L2=J2&" "&SUMPRODUCT(IF(J$2:J2=J2,1/COUNTIFS(I$2:I2,I$2:I2,J$2:J2,J2)))
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,871
Members
449,054
Latest member
juliecooper255

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