Convert several columns of data into two distinct columns

TonyD1016

Board Regular
Joined
Nov 18, 2021
Messages
59
Office Version
  1. 365
Platform
  1. Windows
Hi everyone.
I have an array of data with a number in each row and one to three columns of data in each row that roughly appears like this:
1Data1
2
3Data2Data3Data4
4Data5Data6
5Data7

I need a formula to convert this into two columns.
The first column should contain only the numbers in the first column where data is present in the adjacent columns on each row, repeated for each column on that row. The second columns should contain the data from the next three columns stacked on top of each other.
This formula would make the example set would look like this:

1 Data1
3 Data2
3 Data3
3 Data4
4 Data5
4 Data6
5 Data7

And so on.
How can this be accomplished?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
How about
Fluff.xlsm
ABCDEFG
1
21Data11Data1
323Data2
43Data2Data3Data43Data3
54Data5Data63Data4
65Data74Data5
74Data6
85Data7
Sheet5
Cell Formulas
RangeFormula
F2:G8F2=HSTACK(TOCOL(IF(B2:D10<>"",A2:A10,1/0),2),TOCOL(B2:D10,1))
Dynamic array formulas.
 
Upvote 1
Solution
How about
Fluff.xlsm
ABCDEFG
1
21Data11Data1
323Data2
43Data2Data3Data43Data3
54Data5Data63Data4
65Data74Data5
74Data6
85Data7
Sheet5
Cell Formulas
RangeFormula
F2:G8F2=HSTACK(TOCOL(IF(B2:D10<>"",A2:A10,1/0),2),TOCOL(B2:D10,1))
Dynamic array formulas.
This worked perfectly. Thank you very much!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

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