Extract Unique Values From A Single Cell Formula

legalhustler

Well-known Member
Joined
Jun 5, 2014
Messages
1,171
Office Version
  1. 365
Platform
  1. Windows
I have a single cell formula that uses the TEXTJOIN function and returns multiple values. Although some answers are returning duplicate values (which is working as designed b/c multiple instances do appear when I do the look up), but I want to only show the unique values in my single cell solution. For example my formula is returning the following in a single cell, separated by commas:

5,15,20,15,25

I want to further amend my formula below so that it only shows 5,15,20, 25

={TEXTJOIN(",",1,IF(Customers!$B$1:$B$1000=$A3,IDs!$A$1:$A$1000,""))}

Any help is appreciated. TIA!
 
Try:

=TEXTJOIN(",",1,IFERROR(IF(MATCH($A4&"|"&INDIRECT(E$1&"!A1:A1000"),INDIRECT(E$1&"!B1:B1000")&"|"&INDIRECT(E$1&"!A1:A1000"),0)=ROW(INDIRECT(E$1&"!A1:A1000"))-ROW(INDIRECT(E$1&"!A1"))+1,INDIRECT(E$1&"!A1:A1000"),""),""))

with CSE.

Awesome! Worked beautifully.
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hi,
Can you please post your excel sheet.. I am a bit confused with the E1 Cell

E1 is header name which is the same as my lookup sheet name. I'm using the header name of the column to look up the sheet via INDIRECT.
 
Upvote 0
ALso you can use Unique function if you are using office 365
=TEXTJOIN(",",1,UNIQUE(IF(Customers!$B$1:$B$1000=$A3,IDs!$A$1:$A$1000,"")))
I don't have the new functions yet, or I'd try it, but I suspect the new FILTER function would work here too.
 
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,835
Members
449,051
Latest member
excelquestion515

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