Y
Y
Yaros752020-12-06 15:30:38
Google Sheets
Yaros75, 2020-12-06 15:30:38

How to execute a formula in GOOGLE SHEETS notation, assembled from text fragments, using a user-defined function?

For example: =RUN ( "=SUM("&A2&")" ) rather than using the equal sign =RUN ( "SUM("&A2&")" )

Simple math expressions are simple.

SCRIPT
function RUN(formula) { return eval(formula) }

=RUN("8*2*3") I get 48

There is no such built-in function in the tables themselves, I know, can it be possible to implement this with a Script? But only as a custom function.

Just sticking the collected formula into a cell from the script is no problem.

Tried from a custom function.
use cell A1 to insert a formula into it, and then pick up and return the result, but was denied access when executing the script.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ivanov, 2020-12-06
@oshliaer

Unfortunately, there is no such interpreter in Tables.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question