Hi
A cell can contain either a formula, like =IF(A1>0,0,501) , or an entered constant value.
So this task (enter and then calculate within the same cell) needs a macro solution,
unless you can use one of the 16 777 214 remaining cells on the worksheet to produce the
result in question for you.