I have this formula
=ROUNDUP(D12/(D6-D5),IFERROR(VLOOKUP(G9,reference!$C$2:$D$7,2,0),100))
and I want to change the ROUNDUP
portion based on text from a separate cell (say, F7
, where the text can be ROUNDDOWN
or ROUND
).
I tried using the SUBSTITUTE()
and REPLACE()
functions. These are a couple of my attempts:
=REPLACE("=ROUNDUP(…)",2,7,F7)
*
=REPLACE(ROUNDUP(…),2,7,F7)
*This version ended up creating the right formula, but it shows as text, not as a formula. I can paste it in another cell and it works. So I tried adding *1
, in this formula but it still didn't work.
A workaround is the use of nested IF
, but that will create far too many lines so I was hoping for another option.
F7
?F7
, @Rajesh. @FezzikMontoya, that's what I was afraid of.