App script to transform columns of months

Skip to first unread message

Reza Azmi

Jan 27, 2023, 5:56:17 AMJan 27
to Google Apps Script Community

Need some help to develop a script that will be able to summarize data (Column of values for a given month) for each member (in rows).

My sheet looks like this.

Screenshot 2023-01-27 at 18.47.32.png
I am trying to copy from one sheet to another, but I want the data for months to be summed for all years beginning from 2014 all the way to the end of the columns (last year or latest month-year entry). We keep adding to this sheet. 

Ideally .... we should end up with:

Member Information XXX |  2014 | Entries for 2014 | 2015 | Entries for 2015 etc
Member X  ....
Member Y....
Member Z ....

I am still struggling to understand the way to logically structure the script to make this happen. I can copy and paste the data with a script (my current level!).

Any suggestions or tips? 




Jan 29, 2023, 12:42:37 AMJan 29
Dear Reza,
Unfortunately the screenshot you have shared does not provide enough information for me to make any real suggestions to solve your problem - can you create a dummy data sheet that you share with us so that we can get a better idea of what you want to achieve?
From what you have provided, it sounds like you can probably achieve this using the native GoogleSheets formulas, without having to resort to scripting, but without more info, that’s tricky to suggest anything either.

------ Original Message ------
From "Reza Azmi" <>
To "Google Apps Script Community" <>
Date 1/27/2023 1:56:17 PM
Subject [Apps-Script] App script to transform columns of months

You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Reza Azmi

Jan 29, 2023, 9:32:01 PMJan 29
to Google Apps Script Community
I think I solved the main part of this as I found a solution here:

I can now at least "unpivot" my table and now have a data table i can work from. 



Reply all
Reply to author
0 new messages