# Use Text in cell as formula in Google Sheets

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.

• Correction?: B1's formula reads "=A1+A2" (without quotes) resulting in the value of 3 in cell B1 Aug 24 '20 at 21:38
• Dang nice catch. Correcting now.
– PY_
Aug 24 '20 at 21:40
• Have you read Convert a text string to a formula in a spreadsheet? Four years old, which is a long time, but off the top of my head, I can't think of a better solution. (which possibly means there IS a better solution) ;-) Aug 24 '20 at 21:45
• First time seeing it. I am sure I am not using the correct search terms. That one from what i can see is using google scrip to make it work. So i am guessing that I cant do what i want in a formula only then?
– PY_
Aug 24 '20 at 21:58
• Is the formula as predictable as in your example scenario? Aug 24 '20 at 22:47

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