single formula to cover entire array column?

excelNewbie22

Well-known Member
Joined
Aug 4, 2021
Messages
528
Office Version
  1. 365
Platform
  1. Windows
hi,
how can i use a formula with an array instead of fill down?
like in the example, i want the formula in i2 to split the text of all the array of col h
like
Excel Formula:
=TEXTSPLIT(H2,"-",,,,)
only to cover all col h
so if add # like
Excel Formula:
=TEXTSPLIT(H2#,"-",,,,)
it returns just the first number, like in p2

possible?
test.xlsb
ABCDEFGHIJKLMNOPQRSTU
11234567
21-2-3-4-5-61234561
31-2-3-4-5-71
41-2-3-4-6-71
51-2-3-5-6-71
61-2-4-5-6-71
71-3-4-5-6-71
82-3-4-5-6-72
test
Cell Formulas
RangeFormula
H2:H8H2=LET(d,TOROW(A1:G1,1,1),N,6,c,COUNT(d),x,BYROW(IF(MOD(INT(SEQUENCE(2^c,,0)/2^SEQUENCE(,c,0)),2),d,""),LAMBDA(r,IF(COUNT(r)=N,TEXTJOIN("-",,r),""))),FILTER(x,x<>""))
I2:N2I2=TEXTSPLIT(H2,"-",,,,)
P2:P8P2=TEXTSPLIT(H2#,"-",,,,)
Dynamic array formulas.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
How about
Excel Formula:
=DROP(REDUCE("",H2#,LAMBDA(a,b,VSTACK(a,TEXTSPLIT(b,"-")))),1)
 
Upvote 0
Solution
it's perfect, but when i'm trying it on a large amount of rows, like 80000 rows or so, it get stucked
 
Upvote 0
That's the problem with some of the lambda functions like that on large amounts of data. You've just got to be patient, or use a drag down formula.
 
Upvote 0
Hello Fluff

help on the syntax

I looked at the formula and I tried it.
H2# did not work for me but this did =DROP(REDUCE("",H2:H10,LAMBDA(a,b,VSTACK(a,TEXTSPLIT(b,"-")))),1)

Please explain the syntax.
I am not sure what is defined with letters a and b.
I have used Lambda's with a few challenges but some of the syntax is very new to me.

Thanks in advance.

Drop.xlsm
HIJKLMNO
1
21-2-3-4-5-6-71234567
31-2-3-4-5-6-71234567
41-2-3-4-5-6-71234567
51-2-3-4-5-6-71234567
61-2-3-4-5-6-71234567
71-2-3-4-5-6-71234567
81-2-3-4-5-6-71234567
91-2-3-4-5-6-71234567
101-2-3-4-5-6-71234567
11
1a
Cell Formulas
RangeFormula
I2:O10I2=DROP(REDUCE("",H2:H10,LAMBDA(a,b,VSTACK(a,TEXTSPLIT(b,"-")))),1)
Dynamic array formulas.
 
Upvote 0
The # on H2# signifies that it is the 1st cell in a spill range, as H2 is not a spill range on your mini-sheet you need to use H2:H10 as you have done.
 
Upvote 0
ok, think i found something ligther/faster, but still not perfect,

Excel Formula:
=HSTACK(LEFT(H2#, SEARCH("-",H2#,1)-1),MID(H2#, SEARCH("-",H2#) + 1, SEARCH("-",H2#,SEARCH("-",H2#)+1) - SEARCH("-",H2#) - 1),MID(H2#, SEARCH("-",H2#) + 3, SEARCH("-",H2#,SEARCH("-",H2#)+2) - SEARCH("-",H2#) - 1),MID(H2#, SEARCH("-",H2#) + 5, SEARCH("-",H2#,SEARCH("-",H2#)+2) - SEARCH("-",H2#) - 1),MID(H2#, SEARCH("-",H2#) + 7, SEARCH("-",H2#,SEARCH("-",H2#)+2) - SEARCH("-",H2#) - 1),MID(H2#, SEARCH("-",H2#) + 9, SEARCH("-",H2#,SEARCH("-",H2#)+2) - SEARCH("-",H2#) - 1))

the above formula good only while each number is single, but when one of them is two digits, it return -,
can anyone help me out change the formula to be adjusted to any length number that may be? always seperated by -
 
Upvote 0
bumping...
and temporary remove the solution mark for others can see my ask, up☝️
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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