combining a textjoin(with ifs) and LEFT formula

paulpfl

New Member
Joined
May 11, 2018
Messages
6
Office Version
  1. 365
Platform
  1. Windows
I am attempting to combine the two below steps to reduce two columns to one.
Maybe, I am going about this all wrong but I am looking for a solution to look for a value that is on L List in the column for ref_num but I have to separate it from those numbers. If it's there, display just the match. If it's not there, display this first three numbers from T2.

=TEXTJOIN(",",TRUE,IF(COUNTIF(S2,"*"&L_List&"*"), L_List,""))
=IF(V2="",LEFT(T2,3),V2)

When I tried this formula to combine it (Unsuccessful Attempt):
=TEXTJOIN(",",TRUE,IF(COUNTIF(S2,"*"&L_List&"*"), L_List,LEFT(T2,3)))
I'd get this answer:
022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022,022


1650639143143.png

1650638516004.png

1650638743071.png


Thank you in advanced! I have been stuck on a few issues with this sheet on and off for a couple weeks and this one is at the top of my list.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Try this:
Excel Formula:
IF(TEXTJOIN(",",TRUE,IF(COUNTIF(S2,"*"&L_List&"*"), L_List,""))="",LEFT(T2,3),TEXTJOIN(",",TRUE,IF(COUNTIF(S2,"*"&L_List&"*"), L_List,"")))
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or 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
Try this:
Excel Formula:
IF(TEXTJOIN(",",TRUE,IF(COUNTIF(S2,"*"&L_List&"*"), L_List,""))="",LEFT(T2,3),TEXTJOIN(",",TRUE,IF(COUNTIF(S2,"*"&L_List&"*"), L_List,"")))
Thank you so much!!
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or 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’)
I apologize! I will update now. Thank you for the tip. I am using Microsoft 365 MSO
 
Upvote 0
Thanks for that.
You could also simplify that formula like
Excel Formula:
=LET(t,TEXTJOIN(",",TRUE,IF(COUNTIF(S2,"*"&L_List&"*"), L_List,"")),IF(t="",LEFT(T2,3),t))
 
Upvote 0
Solution
Thanks for that.
You could also simplify that formula like
Excel Formula:
=LET(t,TEXTJOIN(",",TRUE,IF(COUNTIF(S2,"*"&L_List&"*"), L_List,"")),IF(t="",LEFT(T2,3),t))
Woah... gosh I had no idea LET existed.. Off to youtube, to watch 10 videos on it! lol Thank you so much, I really appreciate your help!
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

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