Sort and Organize a Column into Multiple Columns

donstars

New Member
Joined
Sep 25, 2018
Messages
1
Hi all!

I'm working with some data that is pasted in to Cell A1 of Excel. The volume of data occupies Column A and B but can extend thousands of rows down, separated by single empty rows. The data is generally in the following format, where VARIABLE A is in Column A and VARIABLE B is in Column B. The length of the data can vary (e.g. A3:B20 or A3:B150). If I only have a single SECTION, then I'd like to move each SECTION to a new set of columns e.g. C:D for TIME XXX, E:F for TIME YYY, G:H for TIME ZZZ etc.

However(!), in a different data set, I can have multiple SECTIONS at the same time step, so if that's the case, I'd like to group all the time steps together e.g. for four SECTIONs A:H is TIME XXX, I:P is for TIME YYY, Q:X is for TIME ZZZ etc.

SECTION
TIME XXX h
VARIABLE A VARIABLE B
X Y
X Y
X Y
X Y

SECTION
TIME YYY h
VARIABLE A VARIABLE B
X Y
X Y
X Y
X Y

SECTION
TIME ZZZ h
VARIABLE A VARIABLE B
X Y
X Y
X Y
X Y

I have some basic go-bys for moving columns of a fixed size, but I'm struggling with the varying data lengths and some of the logic for grouping timesteps. Any guidance all would be massively appreciated!

Cheers
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,214,822
Messages
6,121,765
Members
449,049
Latest member
greyangel23

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