DEV Community

Cover image for #139 — Interconversion of Rows and Columns in Reverse Order
3 1 1 1 1

#139 — Interconversion of Rows and Columns in Reverse Order

Problem description & analysis:

Here below is a data table:

source table

Task: Now we want to transpose the M columns of a two-dimensional table to M rows, and the transposition order should be: the M-th column, M-1 column, M-2…2, 1. The results are as follows:

expected results

Solution:

Use SPL XLL and enter the following code:

=spl("=transpose(?1).rvs()",Sheet1!A1:D5)
Enter fullscreen mode Exit fullscreen mode

Reverses the order of the columns after transposing.

Script for reverse transposing:

=spl("=transpose(?1).(~.rvs())",Sheet2!A1:E4)
Enter fullscreen mode Exit fullscreen mode

It should be noted what is reversed here is the order of rows.


Download esProc Desktop for FREE and boost productivity today!!! 🚀✨⬇️

✨SPL download address: esProc Desktop FREE Download

✨Plugin Installation Method: SPL XLL Installation and Configuration

✨References to other rich Excel operation cases: Desktop and Excel Data Processing Cases

✨YouTube FREE courses: SPL Programming

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more