In Excel Crosstab, Transpose Cross Cells to Columns and Rows to Cross Cells Respectively

In Excel Crosstab, Transpose Cross Cells to Columns and Rows to Cross Cells Respectively

Problem description & analysis:

In the following Excel crosstab, the left headers are truck numbers, headers at the top are job names, and the cross cells contain job numbers.

ABCD
1Truck NumberJob1Job2Job3
271592859285928
372395859282971
473297159282971

Computing requirement: transpose unique cross cells to column names and the left headers to cross cells.

ABC
1297139585928
2727271
37371
47371
572
673

Solution:

Use SPL XLL to enter the following formula:

=spl("=E@p(?.news(~.m(2:);~:T,get(1):S).group(T;~.(S(1)).sort():TS).(T|TS))",A2:D4)

r/esProc_Desktop - In Excel Crosstab, Transpose Cross Cells to Columns and Rows to Cross Cells Respectively

Explanation:

The news()function generates multiple records according to a sequence; ~.m(2:) means getting members from the current one ~’s second sub-member to the last one; get(1) gets members on the upper layer loop. E@p() function performs transpose members of the sequence.