Google-sheets – Simulate output from a range of values in Google Sheet

google sheetsgoogle-apps-script

I have written functions in a Google Sheet that calculate an input value from C2 and return output value in D2, E2, and F2.

I have a range of values in C9 to C84, and I want to feed these values in C2 to find out what the output values are on D2, E2, and F2.

Doing this by feeding the value one-by-one and copy-and-pasting down the value into D9 to F84 would be too laborious.

Is there a way to automate this using script editor?

Best Answer

Use getValues() to get the values from a range and setValue() to set the value of a cell.