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!
 
Third to last closing bracket is in the wrong place, it should be after the null string.

I would expect a #CALC error if no rows meet the filter criteria, but perhaps one or the other functions overrides that to #N/A
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
You should only get #N/A with that formula if col AG has that error on one of the rows that match the criteria.

Ok, you're right...I used an IFNA formula to make those #N/A show up as "" and now the formula shows a #VALUE error. Would the blanks be causing this to show as #VALUE now?
 
Upvote 0
The $AB column contains a formula which shows either "PARTNER" or "PROJECT" depending on the lookup, I'm not sure if this is causing the #VALUE issue?
 
Upvote 0
No, that would be the mistake that I pointed out in post 21.
Oh ok, all the brackets look correct in the following formula; so I'm not sure why I'm getting VALUE error still.

Excel Formula:
=TEXTJOIN(", ",TRUE,UNIQUE(FILTER('YTD Transactions'!$AG:$AG,('YTD Transactions'!$U:$U=$B16)*('YTD Transactions'!$AB:$AB=$E16)),""))
 
Upvote 0
Get rid of the ,"" at the end of the formula
 
Upvote 0
Oh yeah, I see the bracket issue now; I ended up changing to this and now it works! :)

Excel Formula:
=TEXTJOIN(", ",TRUE,UNIQUE(FILTER('YTD Transactions'!$AG:$AG,('YTD Transactions'!$U:$U=$B16)*('YTD Transactions'!$AB:$AB=$E16),"")))

Thank you for your help with this! @Fluff @jasonb75 :)
 
Upvote 0
As @Fluff has pointed out, you don't need the ,"" part, but without it you will still get an error if there is nothing that meets the criteria.
 
Upvote 0

Forum statistics

Threads
1,214,885
Messages
6,122,090
Members
449,065
Latest member
Danger_SF

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