Sum often does not work well in my experience (or at least the VBA developer environment ... This can be done by inputting the function string into the cell value .
stackoverflow.com