Forum Discussion
Range name in formula
- Jul 15, 2021
David2190 Let's say you enter the name in cell A1.
You can then use INDIRECT(A1) in your formulas to refer to the range whose name is in A1.
David2190 Let's say you enter the name in cell A1.
You can then use INDIRECT(A1) in your formulas to refer to the range whose name is in A1.
- PeterBartholomew1Jul 15, 2021Silver Contributor
- HansVogelaarJul 15, 2021MVP
- PeterBartholomew1Jul 15, 2021Silver Contributor
INDIRECT is the answer to the OP, but it has never been my favourite function because of its volatility. I set out to show an alternative that works when the ranges are collected together as a table. I could also have suggested
= LET( option, XMATCH(Name, Heading), SUM(CHOOSE(option, MyRange, YourRange)) )
As SergeiBaklan points out, besides being aggressively 365, my solutions never use any direct referencing. That just stems from a remark I made that the A1 notation is an abomination that should never have been permitted notation anywhere within an electronic spreadsheet; I feel obliged to stick with my own assertion, even if it obscures my formulas for others.
I apologise for causing confusion; it is me not you!
- David2190Jul 15, 2021Copper ContributorINDIRECT!
Of course you can.
Thanks Hans.