How to get the sheet name from a cell when using a function such as SUM or ArrayFormula?
-
30-05-2021 - |
Question
I have the following formula:
=ArrayFormula(SUM(Morten!$M4:$M400))
How can I replace Morten
with the contents of a cell, ie cell C13
, so that ArrayFormula
will still work?
Solution
Have you tried the Indirect
function?
=ArrayFormula(SUM(Indirect(C13&"!M4:M400")))
But why wrap the Sum
with an ArrayFormula
? Sum
already works with a range like that.
Well, I'll guess you probably simplified the formula to post, removing the part that made ArrayFormula
necessary.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow