Textjoin IF giving all

dmj120

Active Member
Joined
Jan 5, 2010
Messages
286
Office Version
  1. 365
  2. 2019
  3. 2010
I am using textjoin with an if statement that is also using indirect for the tab names.

I've tried playing around, but this forumula just isn't working.
C3 == {=TEXTJOIN(" ",TRUE,(IF(INDIRECT(TEXT($C$2,"Mmmm")&"!$H$3:$H$500")=B4,INDIRECT(TEXT($C$2,"Mmmm")&"!$F$3:$F$500"),"")))}

I have also tried watching a few videos but cannot figured out why all the matching items are listed instead of just the unique items from F3:F500 that equal cell B4. Could it be due to column H3:H500 has duplicate entries as well?

I'm using 2019, so I don't have the unique formula.

1645383788232.png



1645383758088.png
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
cannot figured out why all the matching items are listed instead of just the unique items from F3:F500 that equal cell B4
As you said, you do not have the UNIQUE function and there is nothing in your current formula to identify unique items.
Try this, still entered as an array formula, instead.

Excel Formula:
=TEXTJOIN(" ",TRUE,(IF(INDIRECT(TEXT($C$2,"Mmmm")&"!$H$3:$H$500")=B4,IF(MATCH(B4&"|"&INDIRECT(TEXT($C$2,"Mmmm")&"!$F$3:$F$500"),INDIRECT(TEXT($C$2,"Mmmm")&"!$H$3:$H$500")&"|"&INDIRECT(TEXT($C$2,"Mmmm")&"!$F$3:$F$500"),0)=ROW(INDIRECT(TEXT($C$2,"Mmmm")&"!$F$3:$F$500"))-ROW(INDIRECT(TEXT($C$2,"Mmmm")&"!$F$3"))+1,INDIRECT(TEXT($C$2,"Mmmm")&"!$F$3:$F$500"),""),"")))
 
Upvote 0
Solution
As you said, you do not have the UNIQUE function and there is nothing in your current formula to identify unique items.
Try this, still entered as an array formula, instead.

Excel Formula:
=TEXTJOIN(" ",TRUE,(IF(INDIRECT(TEXT($C$2,"Mmmm")&"!$H$3:$H$500")=B4,IF(MATCH(B4&"|"&INDIRECT(TEXT($C$2,"Mmmm")&"!$F$3:$F$500"),INDIRECT(TEXT($C$2,"Mmmm")&"!$H$3:$H$500")&"|"&INDIRECT(TEXT($C$2,"Mmmm")&"!$F$3:$F$500"),0)=ROW(INDIRECT(TEXT($C$2,"Mmmm")&"!$F$3:$F$500"))-ROW(INDIRECT(TEXT($C$2,"Mmmm")&"!$F$3"))+1,INDIRECT(TEXT($C$2,"Mmmm")&"!$F$3:$F$500"),""),"")))

Thanks Peter!! Works perfectly
 
Upvote 0
You're welcome. Thanks for the confirmation. :)
 
Upvote 0

Forum statistics

Threads
1,215,007
Messages
6,122,670
Members
449,091
Latest member
peppernaut

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