Set formula in a cell based on the contents of another cell?

Google Sheets:

I would like to set the formula in a cell, but this should depend on the contents of another cell.

Example of Google sheet:
https://docs.google.com/spreadsheets/d/1Z2VVLH5saVKJQ97xUNTZ4vssXnw9Q_ruyQF61tCbxsU/edit?usp=sharing

Goal:

The change of cell "aaa" RED should establish the content of "change" in

  • "aaa", if "aaa"
  • "", if nothing"
  • "= ROUNDUP ((1 + 2) / 2)", if "myformula"
  • "= SUM (1 + 2)", if "myformula2"

it's possible?