TEXTJOIN using IF & "addtext" but remove if cell is blank.

Sellsie11

New Member
Joined
Feb 9, 2023
Messages
4
Office Version
  1. 365
Platform
  1. MacOS
I am trying to TEXTJOIN to create links to my filepaths, whilest adding text that I need - but I don't want it to bring back anything when I have no vaule.
Any help would be massivly appriciated.


Saving file paths for CADS.xlsx
ABCDEFGHIJKLMNOPQRSTUV
1File PathStyle CodeCAD1CAD2CAD3CAD4CAD5CAD6CAD7CAD8CAD9CAD10CAD11CAD12CAD13CAD14CAD15CAD16CAD17CAD18
2Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293_61IE874VK540Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293_61I_C_1.png,Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293_E87_C_1.png,Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293_4VK_C_1.png,Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293_540_C_1.png,Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293__C_1.png,Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293__C_1.png,Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293__C_1.png,Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293__C_1.png,Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293__C_1.png,Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293__C_1.png,Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293__C_1.png,Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293__C_1.png,Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293__C_1.png,Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293__C_1.png,Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293__C_1.png,Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293__C_1.png,Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293__C_1.png,Macintosh HD:Users:username:Documents:Clients:filepath:CADS:PKF293__C_1.png
Sheet7
Cell Formulas
RangeFormula
V2V2=TEXTJOIN(",",TRUE,A2&B2&C2:T2&"_C_1.png")
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Try using the LET() formula
=LET(A,TEXTJOIN(",",TRUE,A2&B2&C2:T2&"_C_1.png"),IF(A="","",A))
 
Upvote 0
Try using the LET() formula
=LET(A,TEXTJOIN(",",TRUE,A2&B2&C2:T2&"_C_1.png"),IF(A="","",A))
I've never used the LET function before so not entirely sure what it does. I have put it in your suggestion but I am getting exactly the same results are I had before? Is there something else I need to do to make it work? It still creates the 14 paths extra paths I don't need. Thanks
 
Upvote 0
Try using the below formula :

=TEXTJOIN(",",TRUE,A2&B2&C2:T2&IF(C2:T2<>"","_C_1.png",""))
 
Upvote 0
Try using the below formula :

=TEXTJOIN(",",TRUE,A2&B2&C2:T2&IF(C2:T2<>"","_C_1.png",""))
It works on removing the last section "_C_1.png" but not on removing (A2)&(B2) or the comma that is presumably still being brought in by the textjoin.

Thanks
 
Upvote 0
How about
Excel Formula:
=TEXTJOIN(",",TRUE,A2&B2&FILTER(C2:T2,C2:T2<>"")&"_C_1.png")
 
Upvote 0
Solution
How about
Excel Formula:
=TEXTJOIN(",",TRUE,A2&B2&FILTER(C2:T2,C2:T2<>"")&"_C_1.png")
Thank you for your help! 😊

If you don't mind me asking what is it doing exactly? Would the below be correct?
textjoining with comma A2&B2& filtering/matching values in range C2:T2 that are not equal to "" nothing and only brining those ones back?
 
Upvote 0
textjoining with comma A2&B2& filtering/matching values in range C2:T2 that are not equal to "" nothing and only brining those ones back?
That's right. :)
 
Upvote 0

Forum statistics

Threads
1,216,050
Messages
6,128,498
Members
449,455
Latest member
jesski

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