Textjoin With Multiple "And" Conditions/Criteria?

olimits7

Board Regular
Joined
Oct 29, 2004
Messages
229
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm trying to use a TEXTJOIN with multiple "and" criteria/conditions, I almost got it to work with the following formula but it shows "FALSE" in the text output instead of just being blank. For example, "FALSE, M12345, M45678, M99584, etc.".

Excel Formula:
={TEXTJOIN(", ",TRUE,UNIQUE(IF('YTD Transactions'!$U:$U=$B17,IF(LEFT('YTD Transactions'!$R:$R,2)="43",'YTD Transactions'!$AG:$AG),"")))}

I'm trying to setup 2 different TEXTJOIN's; one where $R:$R equals "43" and the other where it equals "41", and also matches to whatever value is in $B17 under $U:$U.

I also tried this but gives me a #VALUE error.

Excel Formula:
={TEXTJOIN(", ",TRUE,UNIQUE(IF(('YTD Transactions'!$U:$U=$B17)*(LEFT('YTD Transactions'!$R:$R,2)="41"),'YTD Transactions'!$AG:$AG),""))}

Thank you!
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Does col R have 43 or is that just the 1st 2 characters in the cell?

I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
In column R, 43 is just the 1st 2 characters; it really shows "430001" and "410001".

Ok, thanks...I updated my account information.
 
Upvote 0
First one is missing a blank / null string for thr fist IF, second one the blank / null string is in UNIQUE, not the FALSE argument of IF, although if you have UNIQUE then you should have FILTER, so I would use that instead of IF.
Excel Formula:
=TEXTJOIN(", ",TRUE,UNIQUE(FILTER('YTD Transactions'!$AG:$AG,('YTD Transactions'!$U:$U=$B17)*(LEFT('YTD Transactions'!$R:$R,2)="43"),"")))
Personally, I would use dynamic ranges for this, not entire columns.
 
Upvote 0
First one is missing a blank / null string for thr fist IF, second one the blank / null string is in UNIQUE, not the FALSE argument of IF, although if you have UNIQUE then you should have FILTER, so I would use that instead of IF.
Excel Formula:
=TEXTJOIN(", ",TRUE,UNIQUE(FILTER('YTD Transactions'!$AG:$AG,('YTD Transactions'!$U:$U=$B17)*(LEFT('YTD Transactions'!$R:$R,2)="43"),"")))
Personally, I would use dynamic ranges for this, not entire columns.

Oh ok, FILTER seems to work but then how to I use FILTER to show the different set of values when it equals "41" instead?

Ty.
 
Upvote 0
Just change the 43 in the formula to 41
 
Upvote 0
Just change the 43 in the formula to 41
But I need both conditions to be met in a single formula; for example, show values when it equals 41 and also show different set of values when it equals 43?
 
Upvote 0
I tried this but doesn't seem to calculate properly.

Excel Formula:
{=TEXTJOIN(", ",TRUE,IF(LEFT('YTD Transactions'!$R:$R,2)="43",(UNIQUE(FILTER('YTD Transactions'!$AG:$AG,('YTD Transactions'!$U:$U=$B17)*(LEFT('YTD Transactions'!$R:$R,2)="43"),""))),(IF(LEFT('YTD Transactions'!$R:$R,2)="41",(UNIQUE(FILTER('YTD Transactions'!$AG:$AG,('YTD Transactions'!$U:$U=$B17)*(LEFT('YTD Transactions'!$R:$R,2)="41"),""))),""))))}
 
Upvote 0
Perhaps this one,
Excel Formula:
=TEXTJOIN(", ",TRUE,UNIQUE(FILTER('YTD Transactions'!$AG:$AG,('YTD Transactions'!$U:$U=$B17)*((LEFT('YTD Transactions'!$R:$R,2)="43")+(LEFT('YTD Transactions'!$R:$R,2)="41")),"")))
There are a few ways to interpret what you asked for so I've gone with the most common one.
 
Upvote 0
Firstly you do not need to use Ctrl Shift Enter on 365. ;)
Secondly I'm afraid I don't understand what you are after.
 
Upvote 0

Forum statistics

Threads
1,214,904
Messages
6,122,169
Members
449,070
Latest member
webster33

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