Forum Discussion
dynamic offset with lookup of location
I need H3 in the attached to take the value selected in H2 and search in column A to find the location of that line...then sum up the number of values in the first X columns (selected in K2).
Any thoughts?
10 Replies
- TwifooSilver ContributorThe formula in H3 is:
=SUM(INDEX(B2:B8,MATCH(H2,A2:A8,0)):
INDEX(B2:D8,MATCH(H2,A2:A8,0),K2))- txrussianguyBrass Contributor
Twifoo, What if I did not know where the table of lookup values would be? Rather, I know it'll be on the second row, but perhaps 20 columns to the right. Is there a way to modify the formula to find some starter cell value (assume it's unique), which would mark the upper left corner of the range? So as shown in the revised attached, if I had this setup, and needed one formula, that based on the entry to the right of it, would find the appropriate range, and do the same operation you've expertly instructed in the last post...how could the formula be modified?
- txrussianguyBrass Contributor
Twifoo, any further thoughts that could help me get to this? Basic logic I need is:
1) start at A1, and go right until you find what's in Range Selection
2) from that cell, go down until you find the Row Item
3) in that row, give me the column represented by "Which Answer" selection
I think it's a combination of your index/match functions, set to be one within another, but I don't know how to order them. Hope you have an idea. This would expand the potential of the model into which this would go, exponentially.
Thanks.