Range with row numbers derived from another cell

Hi all!
If I refer to a range as [D1]6:[D1]8 in a SUM (where my column id is D1 and the range contains rows 6,7,8), is there a way to replace the hard-coded 6 and 8 by values stored in another cell. For example, let's say [code]1 contains 6.
Is there way to use that value of the cell [code]1 inside the formula: [D1][code]1 ? Or use INDEX to retrieve the value of 6 from [code]1 and use that return value in the range?
Thanks!
Best Answer
-
Hi @Zsolt
You could use INDEX to find a value in Column D1 based on a row number specified in Code1, yes:
INDEX([D1]:[D1], Code1)
However, in order to then SUM multiple values based on your Code column, you'd have to specify each cell, like so:
=SUM(INDEX([D1]:[D1], Code1), INDEX([D1]:[D1], Code2), INDEX([D1]:[D1], Code3))
Let me know if this is what you were looking to do!
Cheers,
Genevieve
Need more information? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao!👋 | Global Discussions
Answers
-
Hi @Zsolt
You could use INDEX to find a value in Column D1 based on a row number specified in Code1, yes:
INDEX([D1]:[D1], Code1)
However, in order to then SUM multiple values based on your Code column, you'd have to specify each cell, like so:
=SUM(INDEX([D1]:[D1], Code1), INDEX([D1]:[D1], Code2), INDEX([D1]:[D1], Code3))
Let me know if this is what you were looking to do!
Cheers,
Genevieve
Need more information? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao!👋 | Global Discussions
-
Thank you, this workaround solve it!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 67K Get Help
- 441 Global Discussions
- 154 Industry Talk
- 502 Announcements
- 5.4K Ideas & Feature Requests
- 85 Brandfolder
- 156 Just for fun
- 79 Community Job Board
- 512 Show & Tell
- 34 Member Spotlight
- 2 SmartStories
- 307 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!