Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get unique values in a column using excel formula

I have Excel Data like below

       JID     Val

       1001    22
       1030    6
       1031    14          
       1041    8
       1001    3
       2344    8
       1030    8
       2344    6
       1041    8

How do i get the unique JID values like below using formula?

UJID   

1001
1030
1031
1041    
2344
like image 936
sam Avatar asked Jun 10 '14 16:06

sam


1 Answers

Here is a solution to get a list of unique items from your tables

There is two parts to this solution.

Part 1) Unique Count

{=SUM(IF(FREQUENCY(IF($A$2:$A$10<>"",MATCH($A$2:$A$10,$A$2:$A$10,0)),ROW($A$2:$A$10)-ROW($A$2)+1),1))}

This will count the number of unique items in your data table and will ignore any blanks

*Note this is an array formula and you will need to use "Ctrl" + "Shift" + "Enter" to use

Part 2) Unique List

This formula will give you the list of unique items in your table

={IF(ROWS($E$5:E5)>$E$2,"",INDEX($A$2:$A$10,SMALL(IF(FREQUENCY(IF($A$2:$A$10<>"",MATCH($A$2:$A$10,$A$2:$A$10,0)),ROW($A$2:$A$10)-ROW($A$2)+1),ROW($A$2:$A$10)-ROW($A$2)+1),ROWS($E$5:E5))))}

again this is an array formula. You can then drag this formula down to get all the unique items.

This formula is a dynamic formula, meaning you can set the data range past your current data range and the list will update as you enter new values.

*Here is a great video to watch to understand this further

https://www.youtube.com/watch?v=3u8VHTvSNE4

enter image description here

like image 106
josh2205 Avatar answered Sep 19 '22 16:09

josh2205