Return Unique Value in Excel Using Formula

andersen_yunan

New Member
Joined
Feb 7, 2018
Messages
36
Hi, is there any ways to return unique value in excel using formula? For instance as below:

NameFruit
AbiApple
AbiApple
RexWatermelon
ClaudiaOrange
RickyGrape
AbiOrange
RexPear
Count of Unique Fruit5

<tbody>
</tbody>

Unique Value
Apple
Watermelon
Orange
Grape
Pear


Thanks in advance!
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Try this:

Excel 2016 (Windows) 32 bit
A
B
C
D
E
1
ARRAY Formula in D2
2
AbiAppleApple {=IFERROR(INDEX($B$2:$B$8, MATCH(0,COUNTIF($D$1:D1, $B$2:$B$8), 0)),"")}
3
AbiAppleWatermelon
4
RexWatermelonOrange
5
ClaudiaOrangeGrape
6
RickyGrapePear
7
AbiOrange
8
RexPear
9
Sheet: Sheet1
ARRAY formula in D2 copied down
=IFERROR(INDEX($B$2:$B$8, MATCH(0,COUNTIF($D$1:D1, $B$2:$B$8), 0)),"")

An array formula must be committed with CTRL}{SHIFT}{ENTER} and then it will be enclosed in curly brackets and look like this (you cannot type in the brackets!!)
{=IFERROR(INDEX($B$2:$B$8, MATCH(0,COUNTIF($D$1:D1, $B$2:$B$8), 0)),"")}
 
Last edited:
Upvote 0
Try this:

Excel 2016 (Windows) 32 bit
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]A[/COLOR]​
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]B[/COLOR]​
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]C[/COLOR]​
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]D[/COLOR]​
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]E[/COLOR]​
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]1[/COLOR]​
ARRAY Formula in D2
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]2[/COLOR]​
AbiAppleApple {=IFERROR(INDEX($B$2:$B$8, MATCH(0,COUNTIF($D$1:D1, $B$2:$B$8), 0)),"")}
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]3[/COLOR]​
AbiAppleWatermelon
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]4[/COLOR]​
RexWatermelonOrange
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]5[/COLOR]​
ClaudiaOrangeGrape
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]6[/COLOR]​
RickyGrapePear
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]7[/COLOR]​
AbiOrange
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]8[/COLOR]​
RexPear
[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]9[/COLOR]​

<tbody>
</tbody>
Sheet: Sheet1

<tbody>
</tbody>
ARRAY formula in D2 copied down
=IFERROR(INDEX($B$2:$B$8, MATCH(0,COUNTIF($D$1:D1, $B$2:$B$8), 0)),"")

An array formula must be committed with CTRL}{SHIFT}{ENTER} and then it will be enclosed in curly brackets and look like this (you cannot type in the brackets!!)
{=IFERROR(INDEX($B$2:$B$8, MATCH(0,COUNTIF($D$1:D1, $B$2:$B$8), 0)),"")}


Hi Yongle,

Thanks for your response! How about the other way around when i want to return the duplicate value only?
For instance:
Apple
Orange
 
Upvote 0
NORMAL formula in D2 copied down

=IFERROR(LOOKUP(2,1/(((COUNTIF($D$1:D1, $B$2:$B$9)=0)*(COUNTIF($B$2:$B$9, $B$2:$B$9)>1))), $B$2:$B$9),"")

<tbody>
</tbody>


Excel 2016 (Windows) 32 bit
A
B
C
D
E
1
Duplicated itemsNORMAL formula in D2
2
AbiApplePear =IFERROR(LOOKUP(2,1/(((COUNTIF($D$1:D1, $B$2:$B$9)=0)*(COUNTIF($B$2:$B$9, $B$2:$B$9)>1))), $B$2:$B$9),"")
3
AbiAppleOrange
4
RexWatermelonApple
5
ClaudiaOrange
6
RickyGrape
7
AbiOrange
8
RexPear
9
RhonaPear
10
Sheet: Sheet1
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,739
Members
449,050
Latest member
excelknuckles

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