Google-sheets – Use Text in cell as formula in Google Sheets

excel-onlinegoogle sheetsmicrosoft excel

I am working on a way of building out a formula rather than a bunch of if/then statements. Is there a way I can convert the text from one cell and use that text as the formula of another?

Example:

A1 = 1
A2 = 2
B1's formula reads "=A1+A2" (without quotes) resulting in the value of 3 in cell B1

In C1, if i literally have the text value of "A1+A2" without the quotes, is there a way in cell D1 i can reference the text of C1 to display the value of 3?

I tried ="=" & indirect(C1) and =indirect("=" & C1) but both fail.

Best Answer

Try this formula in cell D1:

=(indirect(left(C1,find("+",C1)-1)))+(indirect(right(C1,len(C1)-find("+",C1))))

The logic is explained in the screenshot


Sample

Sample