Many people are asking why I want to do this. I want to do this so that when I do my mail merge (this sends students their overdue book lists from the library), I don't send a student an email more than once. I never use this data more than once, I only use it to send a quick message, I never manipulate or work with the data so I don't care if it's hard to work with! I hope this makes sense! Thank you for your feedback thus far.
Google Sheet starts like this:
I want it to look like this:
I have started some script, which I am sure you will all laugh at (I know very little of programming). However, It'd be awesome to be able to do this. Basically, combine the rows that have an identical entry in column 1, by putting the values for the columns for those rows together into one row. The numbers can be added, and the data separated by a comma or a line break.
This is what I have so far....
function myFunction() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getActiveSheet(); var last = sheet.getLastRow(); //find identical entries in column 1// for(i in data){ var row = data[i]; var duplicate = false; for(j in newData){ if(row.join() == newData[j].join()){ duplicate = true; } } if(!duplicate){ newData.push(row); } } //add information from rows of identical entries into one row using a comma// //delete empty rows// }