# formula for counting unique record

#### polska2180

##### Active Member
Okay, I haven't been able to find this anywhere but I need a formula to count unique records....kinda like with you do a adv. filter and do unique records. But reather then me doing it on every sheet I have I would like a formula. The row I interested is filled with account numbers so:

12324
12324
12554
35758
35412
35412

So this would give a total of 4 unique records....thanks for any help.

### 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

#### Aladin Akyurek

##### MrExcel MVP
polska2180 said:
Okay, I haven't been able to find this anywhere but I need a formula to count unique records....kinda like with you do a adv. filter and do unique records. But reather then me doing it on every sheet I have I would like a formula. The row I interested is filled with account numbers so:

12324
12324
12554
35758
35412
35412

So this would give a total of 4 unique records....thanks for any help.

One of:

1]

=SUM(IF(A2:A7<>"",1/COUNTIF(A2:A7,A2:A7)))

which needs to be confirmed with control+shift+enter.

2]

=SUMPRODUCT((A2:A7<>"")/COUNTIF(A2:A7,A2:A7))

3] If A2:A7 is numeric...

=SUM(IF(FREQUENCY(A2:A7,A2:A7)>0,1))

#### Greg Truby

##### MrExcel MVP
Oh - Aladin gave us a bonus option versus what he offered up here.

Thanks

Replies
5
Views
473
Replies
2
Views
268
Replies
1
Views
594
Replies
3
Views
193
Replies
8
Views
1K

Threads
1,181,994
Messages
5,933,161
Members
436,883
Latest member
RyanI1986

### 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

### 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