DEV Community

Cover image for #133 — Row-to-Column Conversion for Fixed Columns
Judith-Data-Processing-Hacks
Judith-Data-Processing-Hacks

Posted on

2 1 1 1 1

#133 — Row-to-Column Conversion for Fixed Columns

Problem description & analysis:

Here below is a data table:

source table

Task: Now we want to convert the table to the form as shown in the figure below, and list the scores in the order of Chinese, Maths and English. And the expected results are as follows:

Image description

Solution:

Use SPL XLL and enter the following code:

=spl("=E(?1).pivot(ID,Name;Subject,Score; ""Chinese"",""Maths"",""English"")",Sheet1!A1:D13)
Enter fullscreen mode Exit fullscreen mode

Code explanation:

Perform the row-to-column conversion based on columns ID and Name. The values in the Subject column are transferred and used as the new column names, the values in the Score column are transferred and used as the values in the new columns, and the new column names are arranged in the order of “Chinese”, “Maths”, “English”.


Download esProc Desktop for FREE and eliminate manual errors using SPL XLL!! 🚀✨⬇️

✨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

Image of Datadog

Master Mobile Monitoring for iOS Apps

Monitor your app’s health with real-time insights into crash-free rates, start times, and more. Optimize performance and prevent user churn by addressing critical issues like app hangs, and ANRs. Learn how to keep your iOS app running smoothly across all devices by downloading this eBook.

Get The eBook

Top comments (1)

Collapse
 
judith677 profile image
Judith-Data-Processing-Hacks

Elevate your Excel data game now!

⭐️Discord
⭐️Reddit

nextjs tutorial video

Youtube Tutorial Series 📺

So you built a Next.js app, but you need a clear view of the entire operation flow to be able to identify performance bottlenecks before you launch. But how do you get started? Get the essentials on tracing for Next.js from @nikolovlazar in this video series 👀

Watch the Youtube series