0
votes

I am working with Google Form results data that is being dropped into a Google Sheet tab and I added a column to calculate the percentage of the quiz scores that are then being pulled onto a tracking tab in the same sheet that calculates their percentage completed. Right now the Percent Column is appearing as a blank field no matter which formula I've tried. I am wondering if there is a different formula would work that would automatically apply to the column when new responses are added? Or would a Google Script be a better option?

I am wanting to keep the raw result data on the same sheet since it is compiling all of the quizzes into one Google Sheet with one tab pulling the Percentages to show completion rate.

I have tried ARRAYFORMULA and the formula that works if you copy it manually to each entry is "=left(C2,find("/",C2)-1)/(right(C2,len(C2)-find("/",C2)))"

2

2 Answers

0
votes

Try

=Arrayformula(if(len(C2:C), left(C2:C,find("/",C2:C)-1)/(right(C2:C,len(C2:C)-find("/",C2:C))),))

and see if that works?

0
votes

This function will add a formula in the last column when a new formresponse will be added to the sheet:

function setFormula() {
  var ss=SpreadsheetApp.openById('SHEET_ID');
  var sheet=ss.getSheetByName('SHEET_NAME');
  var lastRow = sheet.getLastRow();
  var formulaRange1 = sheet.getRange(lastRow, sheet.getLastColumn());
  formulaRange1.setValue('=IF($A'+lastRow+'="";"";TODAY()-$Q'+lastRow+')');
}

Your formula must be adjusted accordingly. Just make sure that lastRow is inside the string instead of the line number and add a onFormResponse Trigger. I've added this script to the form, not to the spreadsheet.