Values disappear inconsistently when using TEXTSPLIT

bksbksbks

New Member
Joined
Nov 18, 2024
Messages
7
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. MacOS
  3. Web
The following formula is working perfectly for me:
Excel Formula:
=XLOOKUP(TEXTSPLIT(XLOOKUP(J1,Overview.JobTitle,Overview.OrgLevel),"|"),'Split Assignment List'!$B3:$ZZ3,'Split Assignment List'!$B4:$ZZ4,"")

It generates the following value:
Excel Formula:
Job1|Job2|Job3|Job4

When I wrap the code within a TEXTSPLIT, however, instead of splitting the values into rows (or columns, as I have attempted both), the extra values disappear. The following formula:
Excel Formula:
=TEXTSPLIT(XLOOKUP(TEXTSPLIT(XLOOKUP(J1,Overview.JobTitle,Overview.OrgLevel),"|"),'Split Assignment List'!$B3:$ZZ3,'Split Assignment List'!$B4:$ZZ4,""),,"|")

generates only the value Job1. The thing that makes it especially frustrating, though, is that when I leave the formula without the TEXTSPLIT and reference it in another cell (say the formula is in A1), the result is perfect. This code:
Excel Formula:
=TEXTSPLIT(A1,,"|")
Generates the desired result:
Excel Formula:
Job1
Job2
Job3
Job4

Is there a part of the TEXTSPLIT formula that would eat the other values? I have not encountered this any other time while using the formula.

Thanks for your help!
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
It generates the following value:
Job1|Job2|Job3|Job4
Unclear whether this is a string or array? I'd expect it to return an array from your first formula.

Excel Formula:
=XLOOKUP(TEXTSPLIT(XLOOKUP(J1,Overview.JobTitle,Overview.OrgLevel),"|"),'Split Assignment List'!$B3:$ZZ3,'Split Assignment List'!$B4:$ZZ4,"")
 
Upvote 0
Unclear whether this is a string or array? I'd expect it to return an array from your first formula.

Excel Formula:
=XLOOKUP(TEXTSPLIT(XLOOKUP(J1,Overview.JobTitle,Overview.OrgLevel),"|"),'Split Assignment List'!$B3:$ZZ3,'Split Assignment List'!$B4:$ZZ4,"")
That is the string - the job titles separated by "|"
 
Upvote 0
TEXTSPLIT should return an array. Nested inside XLOOKUP should return an array. It would be helpful if you can post some sample.
 
Upvote 0
TEXTSPLIT should return an array.
I agree

Nested inside XLOOKUP should return an array.
I agree

It would be helpful if you can post some sample.
I agree

@bksbksbks
I suggest that you investigate XL2BB for providing sample data & expected results to make it easier for helpers to understand just what you have & where it is and also what you want & where it is to be. It also allows us to easily copy that data for testing.
(If you have trouble with XL2BB, review the "XL2BB Icons greyed out" link in the 'Known XL2BB issues' section near the top of the XL2BB Instructions page linked above.)
 
Upvote 0
Ah, I have devised some sample data that does behave this way. The issue, as @Cubist has mentioned is that TEXTSPLIT does produce an array. I believe that the issue for you is that it is returning an array of one item & TEXTSPLIT is looking for a simple string to split, not an array containing a simple string.
Try this modification.
Excel Formula:
=TEXTSPLIT(INDEX(XLOOKUP(TEXTSPLIT(XLOOKUP(J1,Overview.JobTitle,Overview.OrgLevel),"|"),'Split Assignment List'!$B3:$ZZ3,'Split Assignment List'!$B4:$ZZ4,""),1),,"|")

If that does not solve the problem then please give us some sample data (any sensitive data disguised or removed) to work with.
 
Upvote 1
Ah, I have devised some sample data that does behave this way. The issue, as @Cubist has mentioned is that TEXTSPLIT does produce an array. I believe that the issue for you is that it is returning an array of one item & TEXTSPLIT is looking for a simple string to split, not an array containing a simple string.
Try this modification.
Excel Formula:
=TEXTSPLIT(INDEX(XLOOKUP(TEXTSPLIT(XLOOKUP(J1,Overview.JobTitle,Overview.OrgLevel),"|"),'Split Assignment List'!$B3:$ZZ3,'Split Assignment List'!$B4:$ZZ4,""),1),,"|")

If that does not solve the problem then please give us some sample data (any sensitive data disguised or removed) to work with.
INDEX solved the problem! Thank you!

I was having issues with XL2BB, but fortunately this did the trick. Hopefully I can figure that out before my next question!
 
Upvote 0
Upvote 0
Do you mind sharing the example for educational purpose? I can't replicate this behavior.
Sure
  1. Put any value in J1 (eg "a")
  2. Put that same value ("a") in named range Overview.JobTitle
  3. In the corresponding position of named range Overview.OrgLevel put any value (eg "z")
  4. In 'Split Assignment List' cell B3 put that same value ("z")
  5. In 'Split Assignment List' cell B4 put say "Job5|Job6|Job7"
  6. Now try the formulas from post 1
 
Upvote 0

Forum statistics

Threads
1,224,591
Messages
6,179,768
Members
452,940
Latest member
rootytrip

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