How to join each row of the output of a choosecols function

kcmuppet

Active Member
Joined
Nov 2, 2005
Messages
437
Office Version
  1. 365
Platform
  1. Windows
Hi

I have a CHOOSECOLS function that returns an array of two columns, and I want to merge/join each row so that I'm left with one column.

ARRAYTOTEXT and TEXTJOIN seem limited to join the whole lot into one cell, which I don't want.

So far all I can think of is joining, then splitting using TEXTSPLIT specifying no column delimiter using an arbitrary symbol like ¦.
Excel Formula:
=TEXTSPLIT(TEXTJOIN(". ",TRUE,CHOOSECOLS(array,9,5)),,"¦.")

It's not very elegant because I have to add that ¦ symbol to the text, and also it adds a space at the beginning of all rows except the first.

Is there a better way?
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
I think VSTACK might do what you want.

Hope that helps,

Doug
 
Upvote 0
Could you perhaps give me another clue?

I thought VSTACK stacks more than one array. My CHOOSECOLS gives only one array of two columns
 
Upvote 0
How about
Excel Formula:
=BYROW(CHOOSECOLS(array,9,5),LAMBDA(br,TEXTJOIN(". ",TRUE,br)))
 
Upvote 1
Solution
If you use VSTACK, you would have to get each column of your CHOOSECOLS array using a LET function, VSTACK(INDEX(your_arr,,1),INDEX(your_arr,,2)). I am sure Fluff's solution is more straightforward to consume.
 
Upvote 0
I'm late to the thread, but here is a formula that does not involve using LAMBDA...
Excel Formula:
=LET(c,CHOOSECOLS(A1:M17,9,5),TAKE(c,,1)&"."&TAKE(c,,-1))
 
Upvote 1

Forum statistics

Threads
1,215,076
Messages
6,122,983
Members
449,092
Latest member
Mr Hughes

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