Identify "nth" unique entry in a list

ellison

Active Member
Joined
Aug 1, 2012
Messages
356
Office Version
  1. 365
Platform
  1. Windows
Hi, is it possible to identify the "nth" unique entry in a list?
In other words: Column A has 8 different unique entries, some duplicated.
So for rows 7 to 8 where the Info is "charlie":
Col B "nth unique entry": charlie is the 5th unique entry on the list (i.e. 1,2,alpha,beta, charlie)
Col C "nth with count": there are 2 duplicates of charlie, so the 1st one (row 8) will be 5.1. And the second row (row 9) 5.2
If it helps, the info in Column is sorted A-Z


Book3
ABC
1Info (a-z)"nth unique entry""nth with count"
2111.1
3222.1
4222.2
5alpha33.1
6beta44.1
7charlie55.1
8charlie55.2
9delta66.1
10echo77.1
11echo77.1
12echo77.1
13foxtrot88.1
14foxtrot88.2
Sheet1




Hope this helps
 
Another option...
Book1
ABCDEF
1Info (a-z)"nth unique entry""nth with count"nnth unique
2111.17echo
3222.1
4222.2
5alpha33.1
6beta44.1
7charlie55.1
8charlie55.2
9delta66.1
10echo77.1
11echo77.2
12echo77.3
13foxtrot88.1
14foxtrot88.2
Sheet1
Cell Formulas
RangeFormula
B2:B14B2=SUM(1/COUNTIF($A$2:A2,$A$2:A2))
C2C2=B2+0.1
C3:C14C3=IF(B3<>B2,B3+0.1,C2+0.1)
F2F2=INDEX(UNIQUE(A2:A14),$E$2)

Doug
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
is there a way that the digits that the counts give to inclue the leading zero's....
How about
Excel Formula:
=LET(d,FILTER(A2:A100,A2:A100<>""),r,ROWS(d),u,UNIQUE(d),x,XMATCH(d,u),HSTACK(x,TEXT(x,"000")&"."&MMULT((SEQUENCE(r)>=SEQUENCE(,r))*(d=TOROW(d)),SEQUENCE(r,,,0))))
 
Upvote 0
Solution
How about
Excel Formula:
=LET(d,FILTER(A2:A100,A2:A100<>""),r,ROWS(d),u,UNIQUE(d),x,XMATCH(d,u),HSTACK(x,TEXT(x,"000")&"."&MMULT((SEQUENCE(r)>=SEQUENCE(,r))*(d=TOROW(d)),SEQUENCE(r,,,0))))
Brilliant!!!

The "simples" way that I found way to go to custom number format and type in 000.000. Then export the results to notepad, and copy and paste it back into Excel to make the changes take effect.

In short, your way is MUCH better! :ROFLMAO: :ROFLMAO:
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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