Home

dynamic offset with lookup of location

%3CLINGO-SUB%20id%3D%22lingo-sub-391595%22%20slang%3D%22en-US%22%3Edynamic%20offset%20with%20lookup%20of%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-391595%22%20slang%3D%22en-US%22%3E%3CP%3EI%20need%20H3%20in%20the%20attached%20to%20take%20the%20value%20selected%20in%20H2%20and%20search%20in%20column%20A%20to%20find%20the%20location%20of%20that%20line...then%20sum%20up%20the%20number%20of%20values%20in%20the%20first%20X%20columns%20(selected%20in%20K2).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20thoughts%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-391595%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-400936%22%20slang%3D%22en-US%22%3ERe%3A%20dynamic%20offset%20with%20lookup%20of%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-400936%22%20slang%3D%22en-US%22%3EWelcome!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-400799%22%20slang%3D%22en-US%22%3ERe%3A%20dynamic%20offset%20with%20lookup%20of%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-400799%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F280482%22%20target%3D%22_blank%22%3E%40Twifoo%3C%2FA%3E%2C%20sorry.%26nbsp%3B%20I%20tried%20putting%20this%20idea%20out%20originally.%26nbsp%3B%20It%20was%20not%20understood.%26nbsp%3B%20I%20tried%20to%20break%20it%20down%20into%20the%20components.%26nbsp%3B%20Obviously%20didn't%20quite%20work%2C%20though%20I%20think%20what%20you%20gave%20me%20comes%20very%20close.%26nbsp%3B%20I'll%20try%20to%20reframe%20it%20in%20another%20post.%3C%2FP%3E%3CP%3EThanks%20again.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-400525%22%20slang%3D%22en-US%22%3ERe%3A%20dynamic%20offset%20with%20lookup%20of%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-400525%22%20slang%3D%22en-US%22%3EYou%20have%20repeatedly%20modified%20the%20scenario%20to%20a%20point%20that%20I%20now%20find%20everything%20ambiguous.%20You%20must%20ensure%20that%20each%20conversation%20you%20start%20is%20limited%20to%20only%201%20scenario%20with%20specific%20results%20you%20want%20to%20achieve.%20Any%20modification%20to%20your%20originally%20given%20scenario%20must%20instead%20be%20posted%20to%20a%20new%20conversation.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-397889%22%20slang%3D%22en-US%22%3ERe%3A%20dynamic%20offset%20with%20lookup%20of%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-397889%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F280482%22%20target%3D%22_blank%22%3E%40Twifoo%3C%2FA%3E%2C%20I%20think%20I've%20not%20done%20a%20good%20job%20at%20explaining%20the%20need.%26nbsp%3B%20See%20attached.%26nbsp%3B%20K14%20has%20what%20I%20think%20you're%20saying%20the%20formula%20needs%20to%20be.%26nbsp%3B%20H16%20I've%20tried%20to%20set%20to%20be%20limited%20to%20the%20CustomerList%20range%20(though%20unsuccessfully)%2C%20which%20should%20be%20a%20named%20range%20that%20I%20can%20change%20to%20expand%20around%20the%20list%20of%20varying%20customer%2Ftarget%20names.%26nbsp%3B%20The%20order%20of%20the%20sections%20of%20assumptions%20(up%20top)%20will%20not%20be%20in%20any%20particular%20order.%26nbsp%3B%20I%20will%20simply%20ensure%20that%20the%20upper%20left%20corner%20of%20any%20of%20them%2C%20is%20within%20the%20list%20of%20customer%20names%20(I'll%20do%20that%20with%20similar%20validation%20rules%2C%20as%20H16%20(assuming%20you%20can%20help%20me%20with%20that%20one%20as%20well).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWith%20that%20in%20mind%2C%20how%20is%20K14%20identifying%20the%20item%20from%20Range%20selection%2C%20and%20then%20using%20that%20range%20as%20the%20one%20within%20which%20it%20goes%20to%20find%20the%20%22Which%20Answer%22%20and%20%22Row%20Item%22%20combo%20that%20I'm%20selecting%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESorry%20if%20I'm%20just%20not%20seeing%20something%20obvious.%26nbsp%3B%20I%20feel%20this%20is%20just%20on%20the%20cusp%20of%20what%20I%20need%2C%20but%20not%20quite%20getting%20there.%26nbsp%3B%20Let%20me%20know%20your%20thoughts.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-394102%22%20slang%3D%22en-US%22%3ERe%3A%20dynamic%20offset%20with%20lookup%20of%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-394102%22%20slang%3D%22en-US%22%3EThe%203%20MATCH%20functions%20return%2C%20the%20row%2C%20column%2C%20and%20area%2C%20respectively.%20Instead%20of%20hard-coding%20the%20ranges%2C%20you%20can%20enter%20them%20in%20F2%3AF21%20for%20the%2020%20ranges%2C%20then%20the%203rd%20MATCH%20will%20look%20like%20this%3A%3CBR%20%2F%3EMATCH(H16%2CF2%3AF21%2C0)%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-394086%22%20slang%3D%22en-US%22%3ERe%3A%20dynamic%20offset%20with%20lookup%20of%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-394086%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F280482%22%20target%3D%22_blank%22%3E%40Twifoo%3C%2FA%3E%2C%20it%20seems%20to%20be%20working%2C%20but%20a%20few%20questions%20(for%20my%20education%2C%20and%20for%20understanding%20what%20I%20can%20and%20can't%20do%20with%20this%20in%20terms%20of%20expansion)%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1)%20if%20I%20were%20to%20add%2020%20similar%20ranges%2C%20of%20varying%20lengths%2C%20to%20the%20right%20of%20these%20two%2C%20would%20this%20work%3F%26nbsp%3B%20If%20not%2C%20what%20can%20be%20done%20to%20allow%20it%20to%3F%3C%2FP%3E%3CP%3E2)%20is%20the%20listing%20in%20the%20last%20match%20(where%20you%20list%20the%20Range%201%2C%20Range%202%2C%20etc.)%20possibly%20to%20not%20have%20hard-coded%2C%20but%20rather%20just%20work%20in%20a%20way%20where%20it%20is%20simply%20looking%20across%20row%201%20for%20a%20match%20to%20the%20words%20found%20in%20H16%2C%20and%20because%20it%20finds%20it%2C%20that's%20how%20it%20knows%20it's%20found%20the%20right%20column%20in%20which%20to%20start%3F%3C%2FP%3E%3CP%3E3)%20just%20for%20my%20understanding%2C%20if%20you%20could%20help%20me%20understand%20what%20the%20different%20lines%20of%20the%20formula%20do%2C%20would%20be%20useful.%26nbsp%3B%20Right%20now%20when%20I%20click%20into%20it%20(and%20the%20coloring%20of%20cells%20shows%20where%20it%20is%20reading)%2C%20I'm%20having%20a%20tough%20time%20understanding%20why%20it's%20highlighting%20the%20first%20row%2Fcolumn%20of%20the%20first%20area%2C%20but%20only%20the%20results%20of%20the%20second%20area.%26nbsp%3B%20And%20again%2C%20this%20may%20tie%20somewhat%20into%20my%20concern%20about%20if%2Fhow%20it's%20possible%20to%20make%20this%20work%20with%20many%20more%20ranges%2C%20placed%20out%20to%20the%20right%20of%20these.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20the%20continued%20support.%20Glad%20that%20at%20least%20one%20version%20works.%26nbsp%3B%20This%20was%20an%20extract%20of%20the%20many%20ranges%20I%20have%2C%20so%20hopefully%20it%20is%20dynamic%20enough%20to%20handle%20those.%20Will%20await%20your%20response.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-393508%22%20slang%3D%22en-US%22%3ERe%3A%20dynamic%20offset%20with%20lookup%20of%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-393508%22%20slang%3D%22en-US%22%3EThe%20%22SUM%22%20label%20of%20the%20result%20in%20H19%20is%20a%20misnomer%20because%20it%20is%20really%20a%20lookup%20value%2C%20wherein%20your%20formula%20is%3A%3CBR%20%2F%3E%3DINDEX((B2%3AD8%2CJ2%3AL8)%2C%3CBR%20%2F%3EMATCH(H14%2CA2%3AA8%2C0)%2C%3CBR%20%2F%3EMATCH(H15%2CB1%3AD1%2C0)%2C%3CBR%20%2F%3EMATCH(H16%2C%7B%22Range%201%22%2C%22Range%202%22%7D%2C0))%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-393483%22%20slang%3D%22en-US%22%3ERe%3A%20dynamic%20offset%20with%20lookup%20of%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-393483%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F280482%22%20target%3D%22_blank%22%3E%40Twifoo%3C%2FA%3E%2C%20any%20further%20thoughts%20that%20could%20help%20me%20get%20to%20this%3F%26nbsp%3B%20Basic%20logic%20I%20need%20is%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1)%20start%20at%20A1%2C%20and%20go%20right%20until%20you%20find%20what's%20in%20Range%20Selection%3C%2FP%3E%3CP%3E2)%20from%20that%20cell%2C%20go%20down%20until%20you%20find%20the%20Row%20Item%3C%2FP%3E%3CP%3E3)%20in%20that%20row%2C%20give%20me%20the%20column%20represented%20by%20%22Which%20Answer%22%20selection%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20think%20it's%20a%20combination%20of%20your%20index%2Fmatch%20functions%2C%20set%20to%20be%20one%20within%20another%2C%20but%20I%20don't%20know%20how%20to%20order%20them.%26nbsp%3B%20Hope%20you%20have%20an%20idea.%26nbsp%3B%20This%20would%20expand%20the%20potential%20of%20the%20model%20into%20which%20this%20would%20go%2C%20exponentially.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-392039%22%20slang%3D%22en-US%22%3ERe%3A%20dynamic%20offset%20with%20lookup%20of%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-392039%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F280482%22%20target%3D%22_blank%22%3E%40Twifoo%3C%2FA%3E%2C%20What%20if%20I%20did%20not%20know%20where%20the%20table%20of%20lookup%20values%20would%20be%3F%26nbsp%3B%20Rather%2C%20I%20know%20it'll%20be%20on%20the%20second%20row%2C%20but%20perhaps%2020%20columns%20to%20the%20right.%26nbsp%3B%20Is%20there%20a%20way%20to%20modify%20the%20formula%20to%20find%20some%20starter%20cell%20value%20(assume%20it's%20unique)%2C%20which%20would%20mark%20the%20upper%20left%20corner%20of%20the%20range%3F%26nbsp%3B%20So%20as%20shown%20in%20the%20revised%20attached%2C%20if%20I%20had%20this%20setup%2C%20and%20needed%20one%20formula%2C%20that%20based%20on%20the%20entry%20to%20the%20right%20of%20it%2C%20would%20find%20the%20appropriate%20range%2C%20and%20do%20the%20same%20operation%20you've%20expertly%20instructed%20in%20the%20last%20post...how%20could%20the%20formula%20be%20modified%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-391600%22%20slang%3D%22en-US%22%3ERe%3A%20dynamic%20offset%20with%20lookup%20of%20location%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-391600%22%20slang%3D%22en-US%22%3EThe%20formula%20in%20H3%20is%3A%3CBR%20%2F%3E%3DSUM(INDEX(B2%3AB8%2CMATCH(H2%2CA2%3AA8%2C0))%3A%3CBR%20%2F%3EINDEX(B2%3AD8%2CMATCH(H2%2CA2%3AA8%2C0)%2CK2))%3C%2FLINGO-BODY%3E
txrussianguy
Contributor

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
The formula in H3 is:
=SUM(INDEX(B2:B8,MATCH(H2,A2:A8,0)):
INDEX(B2:D8,MATCH(H2,A2:A8,0),K2))

@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?

@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.

The "SUM" label of the result in H19 is a misnomer because it is really a lookup value, wherein your formula is:
=INDEX((B2:D8,J2:L8),
MATCH(H14,A2:A8,0),
MATCH(H15,B1:D1,0),
MATCH(H16,{"Range 1","Range 2"},0))

@Twifoo, it seems to be working, but a few questions (for my education, and for understanding what I can and can't do with this in terms of expansion):

 

1) if I were to add 20 similar ranges, of varying lengths, to the right of these two, would this work?  If not, what can be done to allow it to?

2) is the listing in the last match (where you list the Range 1, Range 2, etc.) possibly to not have hard-coded, but rather just work in a way where it is simply looking across row 1 for a match to the words found in H16, and because it finds it, that's how it knows it's found the right column in which to start?

3) just for my understanding, if you could help me understand what the different lines of the formula do, would be useful.  Right now when I click into it (and the coloring of cells shows where it is reading), I'm having a tough time understanding why it's highlighting the first row/column of the first area, but only the results of the second area.  And again, this may tie somewhat into my concern about if/how it's possible to make this work with many more ranges, placed out to the right of these.

 

Thanks for the continued support. Glad that at least one version works.  This was an extract of the many ranges I have, so hopefully it is dynamic enough to handle those. Will await your response.

The 3 MATCH functions return, the row, column, and area, respectively. Instead of hard-coding the ranges, you can enter them in F2:F21 for the 20 ranges, then the 3rd MATCH will look like this:
MATCH(H16,F2:F21,0)

@Twifoo, I think I've not done a good job at explaining the need.  See attached.  K14 has what I think you're saying the formula needs to be.  H16 I've tried to set to be limited to the CustomerList range (though unsuccessfully), which should be a named range that I can change to expand around the list of varying customer/target names.  The order of the sections of assumptions (up top) will not be in any particular order.  I will simply ensure that the upper left corner of any of them, is within the list of customer names (I'll do that with similar validation rules, as H16 (assuming you can help me with that one as well).

 

With that in mind, how is K14 identifying the item from Range selection, and then using that range as the one within which it goes to find the "Which Answer" and "Row Item" combo that I'm selecting?

 

Sorry if I'm just not seeing something obvious.  I feel this is just on the cusp of what I need, but not quite getting there.  Let me know your thoughts.

 

Thanks.

You have repeatedly modified the scenario to a point that I now find everything ambiguous. You must ensure that each conversation you start is limited to only 1 scenario with specific results you want to achieve. Any modification to your originally given scenario must instead be posted to a new conversation.

@Twifoo, sorry.  I tried putting this idea out originally.  It was not understood.  I tried to break it down into the components.  Obviously didn't quite work, though I think what you gave me comes very close.  I'll try to reframe it in another post.

Thanks again.

Welcome!
Related Conversations