Textjoin with wildcard (Search,Unique)

hwong8848

New Member
Joined
Oct 9, 2022
Messages
19
Office Version
  1. 365
Platform
  1. Windows
Hello all!

I have a question regarding looking up similar companies.

For example, in my database, there is AXA Asia, AXA Group or AXA Company Limited. I will look up AXA with search function and filter them out.

My formula is like this

=IFERROR(UNIQUE(FILTER(Uni_Comp_list,ISNUMBER(SEARCH(A2,Uni_Comp_list)))),"N/A")

where A2 is AXA and Uni_Comp_list contain all the different company name.

However the formula will spill since there are more than one match, and I will have to copy and paste it everytime.

I tried using textjoin(",",,True,A2:A16) coupled with the formula above but have no luck.

Any help is appreciated.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
My formula is like this

=IFERROR(UNIQUE(FILTER(Uni_Comp_list,ISNUMBER(SEARCH(A2,Uni_Comp_list)))),"N/A")
That formula does not correspond with your profile information.
1670314434245.png

Does you your profile need to be updated already?

Any chance that we could have a small set of sample data and the expected results, preferably with XL2BB?
 
Upvote 0
Template.xlsx
ABCDEF
1Peer Group 1Current Output and setupDesired OutputUni_Comp_list
2AIAAIAAIAAIAAegon
3China LifeChina Life (Taiwan)China LifeChina Life (Taiwan)Ageas
4China LifeChina PacificChina LifeAXA
5China PacificChina PacificChina Tai pingChina PacificAIA
6China Tai pingChina Tai PingDBSChina Tai PingBNPP Cardif
7DBSDBSFWDDBSAon
8FWDFWDGreat EasternFWDGenerali
9Great EasternGreat EasternHang Seng Great EasternChubb
10Hang SengHang Seng ManulifeHang Seng Chubb Life
11ManulifeManulifeMetlifeManulifeCigna
12Manulife Financial (Canada)New China LifeManulife Financial (Canada)FWD
13Manulife FinancialPing AnManulife FinancialGreat Eastern
14MetlifeMetLifeStandard CharteredMetLifeHannover Re
15MetLife, Inc.United OverseasMetLife, Inc.Liberty
16New China LifeN/AUOBN/AManulife
17Ping AnPing AnPing AnMetLife
18Standard CharteredStandard Chartered BankStandard Chartered BankMunichRe
19Standard CharteredStandard CharteredPeak Re
20United OverseasN/AN/APCA
21UOBUOBUOBPrudential Financial
22QBE
23RGA
24Sun Life
25Swiss Re
26Zurich
27Sompo
28Allianz
29SCOR
30Tokio Marine
31MSIG
32Huatai
33Marsh
34Ping An
35China Pacific
36Cathay
37AIG
38PartnerRe
39Fubon
40FTLife
41HSBC
42Transatlantic
43MCIS
44Etiqa
45General Re
46Muang Thai
47Ocean Life
48NanShan
49TransGlobe
50Shin Kong
51China Life (Taiwan)
52AFLAC
53Travelers
54Hartford Financial Services Group
55Allianz Life Insurance
56Citigroup
57Manulife Financial (Canada)
58Manulife Financial
59Legal & General America
60HSBC Bank
61Sun Life Financial
62Zurich North America
63Barclays
64Aflac Incorporated
65MetLife, Inc.
66Morgan Stanley
67The Hartford Financial Services Group, Inc.
68Allianz SE
69Standard Chartered Bank
70Aviva
71BNP Paribas
72AXA Group
73Allianz Worldwide Partners
74AEGON Group
75ING Bank
76Zurich Insurance Group
77Swiss Reinsurance
78Legal & General Group
79Sun Life Financial Inc.
80American International Group, Inc.
81Prudential Financial, Inc.
82Aegon N.V.
83Assicurazioni Generali S.p.A.
84Zurich Insurance Group AG
85China Tai Ping
86PingAn
87China Life
88Standard Chartered
89UOB
90Hang Seng
91DBS
Peer Group
Cell Formulas
RangeFormula
B2B2=IFERROR(UNIQUE(FILTER(F2:F91,ISNUMBER(SEARCH(A2,F2:F91)))),"N/A")
B3:B21B3=IFERROR(UNIQUE(FILTER(Uni_Comp_list,ISNUMBER(SEARCH(A3,Uni_Comp_list)))),"N/A")
Dynamic array formulas.
Named Ranges
NameRefers ToCells
Uni_Comp_list=Misc!$E$2:$E$91B5:B11, B16:B18, B20:B21, B3, B14
 
Upvote 0
I did not follow what is actually required. You have shown the current output and desired output are exactly same.
On guess. Try this
Excel Formula:
=IFERROR(textjoin(" ",true,(UNIQUE(FILTER(Uni_Comp_list,ISNUMBER(SEARCH(A2,Uni_Comp_list))))),"N/A")
 
Upvote 0
I don't know why your desired output has "N/A" in it twice when that is not one of the entries in Uni_Comp_List that you seem to want to filter?

Could this be what you are after?

hwong8848.xlsm
ABCEF
1Peer Group 1Current Output and setupDesired OutputUni_Comp_list
2AIAAIAAIAAegon
3China LifeChina LifeChina Life (Taiwan)Ageas
4China Life (Taiwan)China LifeAXA
5China PacificChina PacificChina PacificAIA
6China Tai pingChina Tai PingChina Tai PingBNPP Cardif
7DBSDBSDBSAon
8FWDFWDFWDGenerali
9Great EasternGreat EasternGreat EasternChubb
10Hang SengHang Seng Hang Seng Chubb Life
11ManulifeManulifeManulifeCigna
12Manulife FinancialManulife Financial (Canada)FWD
13Manulife Financial (Canada)Manulife FinancialGreat Eastern
14MetlifeMetLifeMetLifeHannover Re
15MetLife, Inc.MetLife, Inc.Liberty
16New China LifePing AnN/AManulife
17Ping AnStandard CharteredPing AnMetLife
18Standard CharteredStandard Chartered BankStandard Chartered BankMunichRe
19UOBStandard CharteredPeak Re
20United OverseasN/APCA
21UOBUOBPrudential Financial
22QBE
23RGA
24Sun Life
25Swiss Re
26Zurich
27Sompo
28Allianz
29SCOR
30Tokio Marine
31MSIG
32Huatai
33Marsh
34Ping An
35China Pacific
36Cathay
37AIG
38PartnerRe
39Fubon
40FTLife
41HSBC
42Transatlantic
43MCIS
44Etiqa
45General Re
46Muang Thai
47Ocean Life
48NanShan
49TransGlobe
50Shin Kong
51China Life (Taiwan)
52AFLAC
53Travelers
54Hartford Financial Services Group
55Allianz Life Insurance
56Citigroup
57Manulife Financial (Canada)
58Manulife Financial
59Legal & General America
60HSBC Bank
61Sun Life Financial
62Zurich North America
63Barclays
64Aflac Incorporated
65MetLife, Inc.
66Morgan Stanley
67The Hartford Financial Services Group, Inc.
68Allianz SE
69Standard Chartered Bank
70Aviva
71BNP Paribas
72AXA Group
73Allianz Worldwide Partners
74AEGON Group
75ING Bank
76Zurich Insurance Group
77Swiss Reinsurance
78Legal & General Group
79Sun Life Financial Inc.
80American International Group, Inc.
81Prudential Financial, Inc.
82Aegon N.V.
83Assicurazioni Generali S.p.A.
84Zurich Insurance Group AG
85China Tai Ping
86PingAn
87China Life
88Standard Chartered
89UOB
90Hang Seng
91DBS
Sheet1
Cell Formulas
RangeFormula
B2:B19B2=SORT(FILTER(Uni_Comp_List,BYROW(Uni_Comp_List,LAMBDA(rw,IFERROR(AGGREGATE(14,6,SEARCH(FILTER(A2:A21,A2:A21<>""),rw),1),0)>0))))
Dynamic array formulas.
Named Ranges
NameRefers ToCells
Uni_Comp_List=Sheet1!$F$2:$F$91B2
 
Upvote 0
@hwong8848
You have not addressed my point about your profile showing Excel 2016 but you are using functions that are not available in Excel 2016. Please re-visit that point.


You have shown the current output and desired output are exactly same.
Current Output is made up of many formulas in various cells, some of which spill and some don't.

1670318671509.png


@hwong8848
If those empty rows in column A were only put there to get that 'manufactured' result with many formulas, then my suggestion could be shortened a bit.

hwong8848.xlsm
ABCF
1Peer Group 1Current Output and setupUni_Comp_list
2AIAAIAAegon
3China LifeChina LifeAgeas
4China PacificChina Life (Taiwan)AXA
5China Tai pingChina PacificAIA
6DBSChina Tai PingBNPP Cardif
7FWDDBSAon
8Great EasternFWDGenerali
9Hang SengGreat EasternChubb
10ManulifeHang Seng Chubb Life
11MetlifeManulifeCigna
12New China LifeManulife FinancialFWD
13Ping AnManulife Financial (Canada)Great Eastern
14Standard CharteredMetLifeHannover Re
15United OverseasMetLife, Inc.Liberty
16UOBPing AnManulife
17Standard CharteredMetLife
18Standard Chartered BankMunichRe
19UOBPeak Re
20PCA
21Prudential Financial
22QBE
23RGA
24Sun Life
25Swiss Re
26Zurich
27Sompo
28Allianz
29SCOR
30Tokio Marine
31MSIG
32Huatai
33Marsh
34Ping An
35China Pacific
36Cathay
37AIG
38PartnerRe
39Fubon
40FTLife
41HSBC
42Transatlantic
43MCIS
44Etiqa
45General Re
46Muang Thai
47Ocean Life
48NanShan
49TransGlobe
50Shin Kong
51China Life (Taiwan)
52AFLAC
53Travelers
54Hartford Financial Services Group
55Allianz Life Insurance
56Citigroup
57Manulife Financial (Canada)
58Manulife Financial
59Legal & General America
60HSBC Bank
61Sun Life Financial
62Zurich North America
63Barclays
64Aflac Incorporated
65MetLife, Inc.
66Morgan Stanley
67The Hartford Financial Services Group, Inc.
68Allianz SE
69Standard Chartered Bank
70Aviva
71BNP Paribas
72AXA Group
73Allianz Worldwide Partners
74AEGON Group
75ING Bank
76Zurich Insurance Group
77Swiss Reinsurance
78Legal & General Group
79Sun Life Financial Inc.
80American International Group, Inc.
81Prudential Financial, Inc.
82Aegon N.V.
83Assicurazioni Generali S.p.A.
84Zurich Insurance Group AG
85China Tai Ping
86PingAn
87China Life
88Standard Chartered
89UOB
90Hang Seng
91DBS
Sheet1 (2)
Cell Formulas
RangeFormula
B2:B19B2=SORT(FILTER(Uni_Comp_List,BYROW(Uni_Comp_List,LAMBDA(rw,IFERROR(AGGREGATE(14,6,SEARCH(A2:A16,rw),1),0)>0))))
Dynamic array formulas.
Named Ranges
NameRefers ToCells
'Sheet1 (2)'!Uni_Comp_List='Sheet1 (2)'!$F$2:$F$91B2
 
Upvote 0
I have
@hwong8848
You have not addressed my point about your profile showing Excel 2016 but you are using functions that are not available in Excel 2016. Please re-visit that point.



Current Output is made up of many formulas in various cells, some of which spill and some don't.

View attachment 80263

@hwong8848
If those empty rows in column A were only put there to get that 'manufactured' result with many formulas, then my suggestion could be shortened a bit.

hwong8848.xlsm
ABCF
1Peer Group 1Current Output and setupUni_Comp_list
2AIAAIAAegon
3China LifeChina LifeAgeas
4China PacificChina Life (Taiwan)AXA
5China Tai pingChina PacificAIA
6DBSChina Tai PingBNPP Cardif
7FWDDBSAon
8Great EasternFWDGenerali
9Hang SengGreat EasternChubb
10ManulifeHang Seng Chubb Life
11MetlifeManulifeCigna
12New China LifeManulife FinancialFWD
13Ping AnManulife Financial (Canada)Great Eastern
14Standard CharteredMetLifeHannover Re
15United OverseasMetLife, Inc.Liberty
16UOBPing AnManulife
17Standard CharteredMetLife
18Standard Chartered BankMunichRe
19UOBPeak Re
20PCA
21Prudential Financial
22QBE
23RGA
24Sun Life
25Swiss Re
26Zurich
27Sompo
28Allianz
29SCOR
30Tokio Marine
31MSIG
32Huatai
33Marsh
34Ping An
35China Pacific
36Cathay
37AIG
38PartnerRe
39Fubon
40FTLife
41HSBC
42Transatlantic
43MCIS
44Etiqa
45General Re
46Muang Thai
47Ocean Life
48NanShan
49TransGlobe
50Shin Kong
51China Life (Taiwan)
52AFLAC
53Travelers
54Hartford Financial Services Group
55Allianz Life Insurance
56Citigroup
57Manulife Financial (Canada)
58Manulife Financial
59Legal & General America
60HSBC Bank
61Sun Life Financial
62Zurich North America
63Barclays
64Aflac Incorporated
65MetLife, Inc.
66Morgan Stanley
67The Hartford Financial Services Group, Inc.
68Allianz SE
69Standard Chartered Bank
70Aviva
71BNP Paribas
72AXA Group
73Allianz Worldwide Partners
74AEGON Group
75ING Bank
76Zurich Insurance Group
77Swiss Reinsurance
78Legal & General Group
79Sun Life Financial Inc.
80American International Group, Inc.
81Prudential Financial, Inc.
82Aegon N.V.
83Assicurazioni Generali S.p.A.
84Zurich Insurance Group AG
85China Tai Ping
86PingAn
87China Life
88Standard Chartered
89UOB
90Hang Seng
91DBS
Sheet1 (2)
Cell Formulas
RangeFormula
B2:B19B2=SORT(FILTER(Uni_Comp_List,BYROW(Uni_Comp_List,LAMBDA(rw,IFERROR(AGGREGATE(14,6,SEARCH(A2:A16,rw),1),0)>0))))
Dynamic array formulas.
Named Ranges
NameRefers ToCells
'Sheet1 (2)'!Uni_Comp_List='Sheet1 (2)'!$F$2:$F$91B2
I have updated my profile details - after checking I have Microsoft 365.


I have tried using your formula and it return #Name? , I suspect that I can't use the function byrow and Lambda, as it does not show any description when I enter them.

Is the a way to do this without these two equations?
Template.xlsx
ABCDEF
1Peer Group 1Current Output and setupDesired OutputUni_Comp_list
2AIA#NAME?AIAAegon
3China LifeChina Life (Taiwan)Ageas
4China PacificChina LifeAXA
5China Tai pingChina PacificAIA
6DBSChina Tai PingBNPP Cardif
7FWDDBSAon
8Great EasternFWDGenerali
9Hang Seng Great EasternChubb
10ManulifeHang Seng Chubb Life
11MetlifeManulifeCigna
12New China LifeManulife Financial (Canada)FWD
13Ping AnManulife FinancialGreat Eastern
14Standard CharteredMetLifeHannover Re
15United OverseasMetLife, Inc.Liberty
16UOBN/AManulife
17Ping AnMetLife
18Standard Chartered BankMunichRe
19Standard CharteredPeak Re
20N/APCA
21UOBPrudential Financial
22QBE
23RGA
24Sun Life
25Swiss Re
26Zurich
27Sompo
28Allianz
29SCOR
30Tokio Marine
31MSIG
32Huatai
33Marsh
34Ping An
35China Pacific
36Cathay
37AIG
38PartnerRe
39Fubon
40FTLife
41HSBC
42Transatlantic
43MCIS
44Etiqa
45General Re
46Muang Thai
47Ocean Life
48NanShan
49TransGlobe
50Shin Kong
51China Life (Taiwan)
52AFLAC
53Travelers
54Hartford Financial Services Group
55Allianz Life Insurance
56Citigroup
57Manulife Financial (Canada)
58Manulife Financial
59Legal & General America
60HSBC Bank
61Sun Life Financial
62Zurich North America
63Barclays
64Aflac Incorporated
65MetLife, Inc.
66Morgan Stanley
67The Hartford Financial Services Group, Inc.
68Allianz SE
69Standard Chartered Bank
70Aviva
71BNP Paribas
72AXA Group
73Allianz Worldwide Partners
74AEGON Group
75ING Bank
76Zurich Insurance Group
77Swiss Reinsurance
78Legal & General Group
79Sun Life Financial Inc.
80American International Group, Inc.
81Prudential Financial, Inc.
82Aegon N.V.
83Assicurazioni Generali S.p.A.
84Zurich Insurance Group AG
85China Tai Ping
86PingAn
87China Life
88Standard Chartered
89UOB
90Hang Seng
91DBS
Peer Group (2)
Cell Formulas
RangeFormula
B2B2=SORT(FILTER(Uni_Comp_list,BYROW(Uni_Comp_list,LAMBDA(rw,IFERROR(AGGREGATE(14,6,SEARCH(A2:A16,rw),1),0)>0))))
Named Ranges
NameRefers ToCells
Uni_Comp_list=Misc!$E$2:$E$91B2
 
Upvote 0
I have updated my profile details - after checking I have Microsoft 365.
Thanks. (y)

I have tried using your formula and it return #Name? , I suspect that I can't use the function byrow and Lambda, as it does not show any description when I enter them.
My understanding is that they should now be available to all 365 subscribers. I would first suggest under File - Account - Update Options - Update Now and see if the functions are then available.
 
Upvote 0
Hello - although I am using Microsoft 365, however corporate limit my ability to update it :cry:
Is there any work around it so that I can recreate what you did? Could the function Let be a substitute of lambda?
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,189
Members
452,616
Latest member
intern444

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