I would like to set a formula into a cell, but this should depend on content of another cell.
Example Google Sheet (anybody can edit): https://docs.google.com/spreadsheets/d/1Z2VVLH5saVKJQ97xUNTZ4vssXnw9Q_ruyQF61tCbxsU/edit?usp=sharing
The RED "aaa" cell change should set the BLUE "changeme" content to
- "aaa", if "aaa"
- "", if "nothing"
- "=ROUNDUP((1+2)/2)", if "myformula"
- "=SUM(1+2)", if "myformula2"
To make the definition clearer, I created a new worksheet "sheet_new (editable)" on the example Google Sheet:
The RED cell change should set the BLUE content to:
- Formula, if RED cell is set to Automatic
- Empty cell, if RED cell is set to Manual
I hope it is clearer now.
Probably using importrange or arrayformula would be the solution.
If RED cell is set to Manual the user can enter numbers manually to BLUE cell. If RED cell is set to Automatic, the value of BLUE cell will be a formula, which calculates the value.