I have a spreadsheet and I want to take a range of data and manipulate it to look differently. I am thinking that I will have set-up multiple loops
1 - To get the main student data (A2:I26) and add it the new sheet.
2- Then loop the range of Test Headings, ex. A,B,C,etc and add those behind the student details.
3- Then another loop to grab the range of scores under each test heading an add them after the test name.
I started writing a script that gets the sheet ranges etc, but I am not sure how to add the loops.
FYI - Some Sheets I have to convert have more Headings of scores than Just A,B,C...Some Sheets I have to work with might just have A scores, some might have scores for A-E etc.
Thanks for any help you can give.
Brandon
***THE SHEET IMAGES AND SIMPLE SCRIPT ARE BELOW
I am looking to take the sheet that looks like this:

And use a script to make it look like this:
function dataReport() {
var thisSS = SpreadsheetApp.getActiveSpreadsheet(),
classData = thisSS.getSheets()[3], //The Sheet with the original data
dataLastRow = classData.getLastRow(),
Avals = classData.getRange("A1:A").getValues(),
Alast = Avals.filter(String).length,
classDataRange = classData.getRange(3, 1,Alast, 9),
dataArray = classDataRange.getValues();
var testNames = classData.getRange(2, 10, 1, classData.getLastColumn()-9),
tnArray = testNames.getValues();
var reportSheet = thisSS.getSheets()[4]; //The sheet to insert the new data
var reportSheetNewRow = reportSheet.getLastRow() +1;
var newDataRange = reportSheet.getRange(reportSheet.getLastRow()+1, 1,Alast, 9);
newDataRange.setValues(dataArray);
}
