Home

multi variable lookup across numerous ranges

%3CLINGO-SUB%20id%3D%22lingo-sub-401485%22%20slang%3D%22en-US%22%3Emulti%20variable%20lookup%20across%20numerous%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-401485%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20the%20attached%2C%20I'm%20looking%20for%20the%20red%2Fwhite%20cell%20to%20do%20the%20following%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1)%20based%20on%20the%20selection%20in%20H16%20(Customer%20Selection)%2C%20look%20across%20the%20top%20until%20it%20find%20that%20range%20of%20assumptions%3C%2FP%3E%3CP%3E2)%20based%20on%20the%20selection%20in%20H14%20(Row%20Item)%2C%20look%20down%20the%20left-most%20column%20of%20the%20relevant%20range%3C%2FP%3E%3CP%3E3)%20based%20on%20the%20selection%20in%20H15%20(Which%20Answer)%2C%20look%20across%20to%20the%20proper%20column%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECaveats%3A%3C%2FP%3E%3CP%3E-%20dates%20across%20the%20top%20of%20each%20region%20are%20in%20order%2C%20but%20not%20consistent%20(not%20the%20same%20for%20each%20section)%3C%2FP%3E%3CP%3E-%20if%20exact%20date%20is%20not%20found%2C%20need%20the%20lesser%20date's%20value%20to%20be%20taken%3C%2FP%3E%3CP%3E-%20if%20needed%20(but%20preferred%20not)%20there%20can%20be%20a%20consistent%20number%20of%20month%20columns%2C%20if%20that%20helps%20define%20the%20width%20of%20each%20range%20within%20the%20formula%3C%2FP%3E%3CP%3E-%20Customers%20across%20the%20top%20won't%20be%20in%20any%20particular%20order%2C%20but%20if%20helpful%2C%20formula%20can%20rely%20on%20the%20fact%20that%20the%20list%20of%20customers%20(in%20defined%20%22CustomerList%22%20range)%20will%20include%20all%20of%20the%20options%20that%20could%20appear%20across%20the%20top%20to%20identify%20the%20ranges%3C%2FP%3E%3CP%3E-%20list%20of%20row%20items%20may%20fluctuate%20between%20customer%20groups%20(meaning%20similar%20to%20dates%2C%20each%20range%20will%20have%20a%20mostly%20consistent%20set%20of%20row%20items%2C%20but%20not%20necessarily%20identical%3C%2FP%3E%3CP%3E-%20there%20will%20be%20a%20constantly%20updated%20set%20of%20customers%20(meaning%20CustomerList%20and%20copies%20of%20the%20ranges...copied%20to%20the%20right%20a%20number%20of%20columns%20away%20from%20the%20last%20one)%2C%20to%20accommodate%20a%20growing%20set%20of%20assumptions%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20someone%20can%20tweak%20this%20to%20work.%20Greatly%20appreciate%20it.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-401485%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-406406%22%20slang%3D%22en-US%22%3ERe%3A%20multi%20variable%20lookup%20across%20numerous%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-406406%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F299524%22%20target%3D%22_blank%22%3E%40txrussianguy%3C%2FA%3E%26nbsp%3B%2C%20that%20could%20be%20better%20to%20transform%20your%20customers%20data%20into%20the%20tables%20or%20named%20ranges%20and%20work%20with%20them.%20Without%20that%20the%20formula%20could%20be%20like%3C%2FP%3E%0A%3CPRE%3E%3DINDEX(A1%3AAZ100%2C%0A%20%20%20MATCH(%24H%2414%2COFFSET(A1%2C%2CMATCH(%24H%2416%2C1%3A1%2C0)-1%2C100)%2C0)%2C%0A%20%20%20MATCH(%24H%2415%2CINDEX(%0A%20%20%20%20%20%20INDEX(1%3A1%2CMATCH(%24H%2416%2C1%3A1%2C0))%3AINDEX(1%3A1%2C%2CMATCH(1%2CINDEX(--(INDEX(1%3A1%2CMATCH(%24H%2416%2C1%3A1%2C0))%3AAZ1%3D%22%22)%2C0)%2C0)%2BMATCH(%24H%2416%2C1%3A1%2C0)-2)%2C%0A%20%20%20)%2C1)%2B%0A%20%20%20MATCH(%24H%2416%2C1%3A1%2C0)-1)%3C%2FPRE%3E%0A%3CP%3Eassuming%20all%20your%20data%20is%20within%20A1%3AAZ100%20range.%3C%2FP%3E%0A%3CP%3E-First%20MATCH%20finds%20the%20number%20of%20tests%20for%20the%20customer%20(we%20may%20take%20entire%20column%20but%20I%20guess%20you%20have%20another%20data%20under%20the%20tests)%3C%2FP%3E%0A%3CP%3ESecond%20MATCH%20finds%20the%20month%20which%20is%20not%20greater%20than%20given%20one.%20Within%20it%20we%20take%20the%20range%20(manipulating%20with%20INDEX)%20from%20customer%20name%20to%20first%20non-blank%20cell%20in%20row%20for%20that%20customer%20(if%20take%20entire%20row%20we%20could%20find%20month%20for%20another%20customer).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-412280%22%20slang%3D%22en-US%22%3ERe%3A%20multi%20variable%20lookup%20across%20numerous%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-412280%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%2C%20Only%20tested%20with%20a%20few%20examples%2C%20but%20holy%20moly.%26nbsp%3B%20You%20seem%20to%20have%20cracked%20it.%26nbsp%3B%20Let%20me%20work%20on%20understanding%20the%20sections%20to%20decipher.%26nbsp%3B%20If%20(more%20likely%20%22once%22)%20I%20run%20into%20a%20roadblock%20in%20understanding%2C%20will%20reach%20out%20and%20tell%20you%20where%20I'm%20stuck.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20already%20am%20on%20knees%20bowing%20forehead%20to%20floor.%26nbsp%3B%20This%20is%20fantastic!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-419532%22%20slang%3D%22en-US%22%3ERe%3A%20multi%20variable%20lookup%20across%20numerous%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-419532%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F299524%22%20target%3D%22_blank%22%3E%40txrussianguy%3C%2FA%3E%26nbsp%3B%2C%20for%20better%20understanding%20you%20may%20check%20components%20of%20above%20as%20separate%20formulas%20with%20using%20Evaluate%20formula%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-575693%22%20slang%3D%22en-US%22%3ERe%3A%20multi%20variable%20lookup%20across%20numerous%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-575693%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%2C%20my%20apologies%20for%20a%20long%20absence.%26nbsp%3B%20I%20got%20hit%20with%20a%20string%20of%20personal%20issues%20(deaths%2C%20broken%20limbs)%20in%20my%20immediate%20circle%2C%20and%20fell%20off%20completely%20from%20this%20project.%26nbsp%3B%20Back%20now%2C%20trying%20to%20get%20a%20handle%20on%20things%20again.%26nbsp%3B%20Could%20I%20ask%20of%20you%20to%20walk%20me%20through%20the%20basic%20flow%20of%20the%20formula%2C%20and%20what%20it%20evaluates%3F%26nbsp%3B%20I%20just%20want%20to%20make%20sure%20I'm%20clear%20on%20what%20the%20core%20blocks%20of%20it%20are%20doing.%26nbsp%3B%20Thanks%20so%20much%20for%20any%20clarification%20on%20order%20and%20logic.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-575920%22%20slang%3D%22en-US%22%3ERe%3A%20multi%20variable%20lookup%20across%20numerous%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-575920%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F277209%22%20target%3D%22_blank%22%3E%40boriss321%3C%2FA%3E%26nbsp%3B%2C%20sorry%20to%20hear%20that%2C%20hope%20all%20your%20issues%20are%20in%20the%20past.%3C%2FP%3E%0A%3CP%3ESure%2C%20I'll%20update%20with%20details%2C%20most%20probably%20tomorrow.%3C%2FP%3E%0A%3CP%3EGood%20luck.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-581224%22%20slang%3D%22en-US%22%3ERe%3A%20multi%20variable%20lookup%20across%20numerous%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-581224%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F277209%22%20target%3D%22_blank%22%3E%40boriss321%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20assume%20all%20your%20data%20in%20first%20hundred%20rows%20and%20columns%20from%20A%20to%20AZ.%20With%3C%2FP%3E%0A%3CPRE%3E%3DINDEX(A1%3AAZ100%2C%20RowNumber%2C%20ColumnNumber)%3C%2FPRE%3E%0A%3CP%3Ewe%20find%20resulting%20value%20in%20that%20range%20based%20on%20our%203%20criteria.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERow%20number%20is%20calculated%20as%3C%2FP%3E%0A%3CPRE%3E%3DMATCH(%24H%2414%2COFFSET(A1%2C%2CMATCH(%24H%2416%2C1%3A1%2C0)-1%2C100)%2C0%3C%2FPRE%3E%0A%3CP%3EHere%3C%2FP%3E%0A%3CPRE%3E%3DMATCH(%24H%2416%2C1%3A1%2C0)%3C%2FPRE%3E%0A%3CP%3Efinds%20position%20of%20the%20cell%20with%20customer%20name%20(H16)%20in%20the%20row%201.%20Let%20assume%20Customer%203%2C%20when%20it%20returns%209%2C%20i.e.%20that's%209th%20column%20(I).%3C%2FP%3E%0A%3CP%3EAfter%20that%20we%20return%20first%20100%20values%20from%20that%20column%20with%3C%2FP%3E%0A%3CPRE%3EOFFSET(A1%2C%2CMATCH(%24H%2416%2C1%3A1%2C0)-1%2C100)%20or%0AOFFSET(A1%2C%2C9-1%2C100)%3C%2FPRE%3E%0A%3CP%3EIn%20returned%20range%20we%20find%20position%20of%20the%20test%20(e.g.%20Test%202)%20with%3C%2FP%3E%0A%3CPRE%3EMATCH(%24H%2414%2COFFSET(A1%2C%2CMATCH(%24H%2416%2C1%3A1%2C0)-1%2C100)%2C0)%20or%0AMATCH(%24H%2414%2CI1%3AI100%2C0)%3C%2FPRE%3E%0A%3CP%3Ewhich%20returns%207.%20That%20is%20our%20row%20number.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EColumn%20number.%3C%2FP%3E%0A%3CP%3EWith%20nested%3C%2FP%3E%0A%3CPRE%3E%3DMATCH(1%2CINDEX(--(INDEX(1%3A1%2CMATCH(%24H%2416%2C1%3A1%2C0))%3AAZ1%3D%22%22)%2C0)%2C0)%3C%2FPRE%3E%0A%3CP%3Ewe%20find%20position%20of%20the%20first%20empty%20cell%20in%20row%201%20starting%20from%20the%20column%20with%20our%20customer%20name%3C%2FP%3E%0A%3CP%3EHere%20with%3C%2FP%3E%0A%3CPRE%3EINDEX(1%3A1%2CMATCH(%24H%2416%2C1%3A1%2C0))%3AAZ1%3C%2FPRE%3E%0A%3CP%3EMATCH%20returns%20the%20position%20for%20it%20in%20the%20first%20row%2C%20INDEX%20returns%20the%20value%20in%20it%2C%20but%20in%20syntax%20as%20INDEX(...)%3AAZ1%20it%20will%20be%20equivalent%20of%20I1%3AAZ1.%20After%20that%20in%20INDEX(--(I1%3AAZ1%3D%22%22)%2C0)%20we%20first%20check%20if%20cell%20is%20empty%20or%20not%20(TRUE%20or%20FALSE)%2C%20double%20dash%20converts%20it%201%20or%200%20and%20finally%20this%20INDEX%20returns%20array%20as%20%7B0%2C0%2C0%2C0%2C1%2C1%2C...%7D.%3C%2FP%3E%0A%3CP%3ENext%20MATCH%20works%20as%20MATCH(1%2C%7B0%2C0%2C0%2C0%2C1%2C1%2C...%7D%2C0)%20and%20returns%20position%20of%20the%20first%20empty%20cell.%20In%20our%20case%205.%3C%2FP%3E%0A%3CP%3EAdding%26nbsp%3B%2BMATCH(%24H%2416%2C1%3A1%2C0)-2)%20we%20receive%20absolute%20column%20position%20of%20the%20of%20the%20last%20not-empty%20column%20for%20that%20customer%20block%2C%20other%20words%20position%20of%20the%20cell%20with%20the%20last%20defined%20date%20(12%20for%20L1).%3C%2FP%3E%0A%3CP%3EFinally%20with%20concept%20of%20dynamic%20range%20the%3C%2FP%3E%0A%3CPRE%3EINDEX(1%3A1%2CMATCH(%24H%2416%2C1%3A1%2C0))%3AINDEX(1%3A1%2C%2CMATCH(1%2CINDEX(--(INDEX(1%3A1%2CMATCH(%24H%2416%2C1%3A1%2C0))%3AAZ1%3D%22%22)%2C0)%2C0)%2BMATCH(%24H%2416%2C1%3A1%2C0)-2)%3C%2FPRE%3E%0A%3CP%3Ewill%20be%20equivalent%20of%20I1%3AL1%3C%2FP%3E%0A%3CP%3EThus%20the%3C%2FP%3E%0A%3CPRE%3EMATCH(%24H%2415%2CINDEX(%0A%20%20%20%20%20%20INDEX(1%3A1%2CMATCH(%24H%2416%2C1%3A1%2C0))%3AINDEX(1%3A1%2C%2CMATCH(1%2CINDEX(--(INDEX(1%3A1%2CMATCH(%24H%2416%2C1%3A1%2C0))%3AAZ1%3D%22%22)%2C0)%2C0)%2BMATCH(%24H%2416%2C1%3A1%2C0)-2)%2C%0A%20%20%20)%2C1)%3C%2FPRE%3E%0A%3CP%3Eis%20converted%20to%3C%2FP%3E%0A%3CPRE%3EMATCH(%24H%2415%2CI1%3AL1%2C1)%3C%2FPRE%3E%0A%3CP%3Ewhich%20with%20last%20parameter%201%20returns%20in%20our%20dynamic%20range%20the%20position%20of%20the%20first%20date%20which%20is%20less%20than%20defined%20in%20our%20criteria%20(3).%20With%20adding%20first%20position%20of%20the%20block%3C%2FP%3E%0A%3CPRE%3E%3DMATCH(%24H%2415%2CI1%3AL1)%2BMATCH(%24H%2416%2C1%3A1%2C0)-1%3C%2FPRE%3E%0A%3CP%3Ewe%20receive%20absolute%20position%20of%20our%20column%20(11).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThus%20our%20entire%20formula%20is%20evaluated%20as%3C%2FP%3E%0A%3CPRE%3E%3DINDEX(A1%3AAZ100%2C%207%2C11)%3C%2FPRE%3E%0A%3CP%3Ewhich%20returns%20desired%20result.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-614135%22%20slang%3D%22en-US%22%3ERe%3A%20multi%20variable%20lookup%20across%20numerous%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-614135%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%2C%20incredibly%20helpful.%26nbsp%3B%20Thank%20you%20so%20much.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-614719%22%20slang%3D%22en-US%22%3ERe%3A%20multi%20variable%20lookup%20across%20numerous%20ranges%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-614719%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F277209%22%20target%3D%22_blank%22%3E%40boriss321%3C%2FA%3E%26nbsp%3B%2C%20you%20are%20welcome%3C%2FP%3E%3C%2FLINGO-BODY%3E
txrussianguy
Contributor

In the attached, I'm looking for the red/white cell to do the following:

 

1) based on the selection in H16 (Customer Selection), look across the top until it find that range of assumptions

2) based on the selection in H14 (Row Item), look down the left-most column of the relevant range

3) based on the selection in H15 (Which Answer), look across to the proper column

 

Caveats:

- dates across the top of each region are in order, but not consistent (not the same for each section)

- if exact date is not found, need the lesser date's value to be taken

- if needed (but preferred not) there can be a consistent number of month columns, if that helps define the width of each range within the formula

- Customers across the top won't be in any particular order, but if helpful, formula can rely on the fact that the list of customers (in defined "CustomerList" range) will include all of the options that could appear across the top to identify the ranges

- list of row items may fluctuate between customer groups (meaning similar to dates, each range will have a mostly consistent set of row items, but not necessarily identical

- there will be a constantly updated set of customers (meaning CustomerList and copies of the ranges...copied to the right a number of columns away from the last one), to accommodate a growing set of assumptions

 

Hope someone can tweak this to work. Greatly appreciate it.

8 Replies
Highlighted

@txrussianguy , that could be better to transform your customers data into the tables or named ranges and work with them. Without that the formula could be like

=INDEX(A1:AZ100,
   MATCH($H$14,OFFSET(A1,,MATCH($H$16,1:1,0)-1,100),0),
   MATCH($H$15,INDEX(
      INDEX(1:1,MATCH($H$16,1:1,0)):INDEX(1:1,,MATCH(1,INDEX(--(INDEX(1:1,MATCH($H$16,1:1,0)):AZ1=""),0),0)+MATCH($H$16,1:1,0)-2),
   ),1)+
   MATCH($H$16,1:1,0)-1)

assuming all your data is within A1:AZ100 range.

-First MATCH finds the number of tests for the customer (we may take entire column but I guess you have another data under the tests)

Second MATCH finds the month which is not greater than given one. Within it we take the range (manipulating with INDEX) from customer name to first non-blank cell in row for that customer (if take entire row we could find month for another customer).

 

@Sergei Baklan, Only tested with a few examples, but holy moly.  You seem to have cracked it.  Let me work on understanding the sections to decipher.  If (more likely "once") I run into a roadblock in understanding, will reach out and tell you where I'm stuck.

 

But already am on knees bowing forehead to floor.  This is fantastic!

@txrussianguy , for better understanding you may check components of above as separate formulas with using Evaluate formula

@Sergei Baklan, my apologies for a long absence.  I got hit with a string of personal issues (deaths, broken limbs) in my immediate circle, and fell off completely from this project.  Back now, trying to get a handle on things again.  Could I ask of you to walk me through the basic flow of the formula, and what it evaluates?  I just want to make sure I'm clear on what the core blocks of it are doing.  Thanks so much for any clarification on order and logic.

@boriss321 , sorry to hear that, hope all your issues are in the past.

Sure, I'll update with details, most probably tomorrow.

Good luck.

@boriss321 ,

 

We assume all your data in first hundred rows and columns from A to AZ. With

=INDEX(A1:AZ100, RowNumber, ColumnNumber)

we find resulting value in that range based on our 3 criteria.

 

Row number is calculated as

=MATCH($H$14,OFFSET(A1,,MATCH($H$16,1:1,0)-1,100),0

Here

=MATCH($H$16,1:1,0)

finds position of the cell with customer name (H16) in the row 1. Let assume Customer 3, when it returns 9, i.e. that's 9th column (I).

After that we return first 100 values from that column with

OFFSET(A1,,MATCH($H$16,1:1,0)-1,100) or
OFFSET(A1,,9-1,100)

In returned range we find position of the test (e.g. Test 2) with

MATCH($H$14,OFFSET(A1,,MATCH($H$16,1:1,0)-1,100),0) or
MATCH($H$14,I1:I100,0)

which returns 7. That is our row number.

 

Column number.

With nested

=MATCH(1,INDEX(--(INDEX(1:1,MATCH($H$16,1:1,0)):AZ1=""),0),0)

we find position of the first empty cell in row 1 starting from the column with our customer name

Here with

INDEX(1:1,MATCH($H$16,1:1,0)):AZ1

MATCH returns the position for it in the first row, INDEX returns the value in it, but in syntax as INDEX(...):AZ1 it will be equivalent of I1:AZ1. After that in INDEX(--(I1:AZ1=""),0) we first check if cell is empty or not (TRUE or FALSE), double dash converts it 1 or 0 and finally this INDEX returns array as {0,0,0,0,1,1,...}.

Next MATCH works as MATCH(1,{0,0,0,0,1,1,...},0) and returns position of the first empty cell. In our case 5.

Adding +MATCH($H$16,1:1,0)-2) we receive absolute column position of the of the last not-empty column for that customer block, other words position of the cell with the last defined date (12 for L1).

Finally with concept of dynamic range the

INDEX(1:1,MATCH($H$16,1:1,0)):INDEX(1:1,,MATCH(1,INDEX(--(INDEX(1:1,MATCH($H$16,1:1,0)):AZ1=""),0),0)+MATCH($H$16,1:1,0)-2)

will be equivalent of I1:L1

Thus the

MATCH($H$15,INDEX(
      INDEX(1:1,MATCH($H$16,1:1,0)):INDEX(1:1,,MATCH(1,INDEX(--(INDEX(1:1,MATCH($H$16,1:1,0)):AZ1=""),0),0)+MATCH($H$16,1:1,0)-2),
   ),1)

is converted to

MATCH($H$15,I1:L1,1)

which with last parameter 1 returns in our dynamic range the position of the first date which is less than defined in our criteria (3). With adding first position of the block

=MATCH($H$15,I1:L1)+MATCH($H$16,1:1,0)-1

we receive absolute position of our column (11).

 

Thus our entire formula is evaluated as

=INDEX(A1:AZ100, 7,11)

which returns desired result.

@Sergei Baklan, incredibly helpful.  Thank you so much.

@boriss321 , you are welcome

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
30 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies