substitute parameters with values in Excel formula
Posted on 2015-02-07
I am looking for a function (preferably) that would do the following:
- input: formula (string) or reference to a cell containing formula
- output: input formula (converted to string) but with parameters substituted with values
let's say I have a formula:
and cell a1=1, a3=3, a5=5
then the result should be =sum(1;3;5)
if the parameter is a range like in vlookup function, for example:
since second parameter is a range then it should remain unchanged.
the sample result should be in this case like:
is there a way (using VBA?) to achieve it in a relatively simple way?