This seems so simple. I do this in coding languages; there’s got to be a way to do this in Excel.
Suppose I have a simple function in a cell, like =if(). And, a chunk of the code in my arguments is repeated. Is there a shortcut to reduce typing.
Some pseudocode might look like this. I would normally write this in a cell:
=if(A1>0,A1,0)
Is there a way to make the middle argument reference all or part of the first argument. As in:
=if(A1>0,LHS of $1,0)
In that pseudocode, LHS of $1 is “left hand side of the first argument”.
Obviously, this is pointless for this simple example, but it could be very useful if the first argument is lengthy, and much of it is repeated in the second argument. OR … am I missing the point, and the preferred methodology for Excel is to put that lengthy argument in its own cell, and then call that address twice?