Share via

Dynamic array function to split value into rows

Anonymous
2024-09-28T11:03:39+00:00

I want to try an array formula that spills

I tried this =HSTACK(J18,TOCOL(TEXTSPLIT(K18," "))) but number in A column doesn't repeat

Sample data

898990 Cat Mat
898767 Nam Bam
767676 Gam Jam

Either way is okay

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Ashish Mathur 101.8K Reputation points Volunteer Moderator
2024-09-28T23:15:16+00:00

Hi,

I would solve this in the Query Editor. However, if you wish to use a formula, then enter this formula in cell D2

=LET(spt,DROP(REDUCE(" ",B2:B4,LAMBDA(a,b,VSTACK(a,TEXTSPLIT(b," ")))),1),HSTACK(TOCOL(IF(spt<>"",A2:A4),2),TOCOL(spt,2)))

Hope this helps.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

Answer accepted by question author

Anonymous
2024-09-28T13:29:46+00:00

This one?

=HSTACK(TEXTSPLIT(TEXTJOIN(" ",,TRIM(REPT(A1:A3&" ",2))),," "),TEXTSPLIT(TEXTJOIN(" ",,B1:B3),," "))

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

6 additional answers

Sort by: Most helpful
  1. Anonymous
    2024-09-29T12:34:16+00:00

    Yes, PQ would split into rows. But I want to make use of dynamic arrays in place for quick analysis also to avoid swithing to query editor for simple things. If its automated task then I will use PQ. We even have pandas in Excel for quick analysis.

    Was this answer helpful?

    0 comments No comments
  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more