I'm trying to give a formula using the equal sign, when submitting a Short answer in a Google Form. If I'm writing


into the form and then submit it, I get the string


in the Google Sheet Response sheet. It does not seem to calculate this function automatically.

When trying to getValue() this cell, I cannot find the quote, and so I cannot execute this function.

Does anyone have any good idea to solve this problem? Is it possible to execute this function in the Response sheet?

1 Answer 1


The following function gets the active range value and set it as the active cell formula:

function stringToFormula() {
  var rng = SpreadsheetApp.getActiveRange();
  var value = rng.getValue();

If the cell value is '=6+7 the cell formula will be =6+7 and the cell display value will be 13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.