In Excel, Combine Every N Row into A New Row

In Excel, Combine Every N Row into A New Row

Problem description & analysis:

In column F, every four rows correspond to one record:

ABCDEF
1NameAddressCityShort IDCompany 1
22222 al street
3Blue cheese
41
5Company 2
61111 arm rd
7Ranch
82
9Company 3
103333 raindrop drive
11Peanut
123

We need to re-arrange column F to make a standard table by entering each record to cells A~D row by row:

ABCDEF
1NameAddressCityShort IDCompany 1
2Company 12222 al streetBlue cheese12222 al street
3Company 21111 arm rdRanch2Blue cheese
4Company 33333 raindrop drivePeanut31
5Company 2
61111 arm rd
7Ranch
82
9Company 3
103333 raindrop drive
11Peanut
123

Solution:

Use SPL XLL to enter the formula below:

=spl("=?.(~(1)).group((#-1)\4)",F1:F12)

As shown in the picture below:

r/esProc_Desktop - In Excel, Combine Every N Rows into A New Row

Explanation:

~(1) represents getting the first sub-member of the current member. The group()function performs a grouping operation by putting members having the same (#-1)\4 into the same group; # represents the ordinal number of a member, and symbol \ means a rounded division.

SPL XLL is now FREE to download and apply: http://www.scudata.com/download-Desktop