Return all Unique Values in a Single Cell with col headings

gavcol

New Member
Joined
Dec 22, 2016
Messages
19
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi,

Similar to this thread (Return all Unique Values Based on Criteria in a Single Cell).

I've modified the formula to suit the first table below but I wanted to include the column headings in brackets for each found occurrence as it appears in the example in the 2nd table below.
Is this possible with a formula (not Vb) ?

Thx in advance
Gav

Book1
ABCDEFG
1AcctDesc1Desc2Desc3Desc4Desc5Unique
2AAA111StartStartBeginFirstStart|Begin|First
3BBB222FinishEndLastLastFinish|End|Last
Sheet1
Cell Formulas
RangeFormula
G2:G3G2=TEXTJOIN("|",TRUE,UNIQUE(B2:F2,TRUE))



AcctDesc1Desc2Desc3Desc4Desc5Unique
AAA111StartStartBeginFirstStart(Desc1, Desc2)|Begin(Desc4)|First(Desc5)
BBB222FinishEndLastLastFinish(Desc1)|End(Desc2)|Last(Desc3, Desc4)
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Try G2: =TEXTJOIN("|",1,UNIQUE(BYCOL(B2:F2,LAMBDA(c,IF(c="","",c&"("&TEXTJOIN(", ",1,IF(B2:F2=c,B$1:F$1,""))&")"))),1))
 
Upvote 0
Solution
Try G2: =TEXTJOIN("|",1,UNIQUE(BYCOL(B2:F2,LAMBDA(c,IF(c="","",c&"("&TEXTJOIN(", ",1,IF(B2:F2=c,B$1:F$1,""))&")"))),1))

Perfect !!
Thank you.

I keep forgetting about LAMBDA. I really should try to incorporate that a bit more often and get used to using it and thinking of it as a solution.
Cheers
Gav
 
Upvote 0

Forum statistics

Threads
1,215,076
Messages
6,122,987
Members
449,093
Latest member
Mr Hughes

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