Returning a value from a discontinuous range (a formatted calendar with data) for a specific date

%3CLINGO-SUB%20id%3D%22lingo-sub-1247306%22%20slang%3D%22en-US%22%3EReturning%20a%20value%20from%20a%20discontinuous%20range%20(a%20formatted%20calendar%20with%20data)%20for%20a%20specific%20date%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1247306%22%20slang%3D%22en-US%22%3E%3CP%3EUsing%20the%20date%20in%20the%20cell%20above%20this%20formula%20I%20need%20to%20find%20the%20value%20in%20a%20cell%2011%20rows%20below%20the%20date%20in%20a%20formatted%20calendar.%20The%20calendar%20is%20lain%20out%20in%20multiple%20rows%20of%20dates%2C%20arranged%20by%20week%20(from%20a%20calendar%20template%20I%20borrowed).%20I've%20assigned%20the%20name%20%22Date_Range%22%20to%20the%20discontinuous%20range%20of%20dates%20on%20the%20calendar.%20I've%20fiddled%20around%20with%20Index-Match%20formulas%20with%20no%20success%20...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20anyone%20throw%20me%20a%20life%20preserver%3F%26nbsp%3B%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ep.s.%20This%20fetches%20the%20manpower%20count%20from%20the%20calendar%20to%20use%20against%20the%20needs%20for%20each%20day.%20To%20complicate%20matters%2C%20the%20calendar%20is%20in%20a%20different%20file%20and%20each%20month%20of%20the%20calendar%20is%20on%20a%20different%20sheet.%20I%20know%20how%20to%20use%20external%20file%20references%20and%20indirect%20to%20get%20to%20the%20the%20file%20name%20and%20sheet.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1247306%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1247811%22%20slang%3D%22en-US%22%3ERe%3A%20Returning%20a%20value%20from%20a%20discontinuous%20range%20(a%20formatted%20calendar%20with%20data)%20for%20a%20specific%20dat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1247811%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F591297%22%20target%3D%22_blank%22%3E%40Rapid_Ron_L%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20it%20at%20all%20possible%20for%20you%20to%20upload%20the%20actual%20files%20(after%20anonomysing%20any%20names).%20Your%20description%20is%20reasonably%20good%2C%20but%20you'd%20still%20be%20lucky%20if%20anybody%20could%20create%20a%20functioning%20formula%20just%20from%20that.%20The%20actual%20spreadsheet(s)%20would%20also%20be%20better%20than%20images....%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EP.S.%20you're%20certainly%20right%20that%20having%20each%20month's%20calendar%20on%20a%20separate%20sheet%20is%20a%20major%20complicating%20factor.%20Are%20you%20in%20a%20position%20to%20make%20major%20changes%20to%20how%20the%20data%20are%20laid%20out%3F%20That%20kind%20of%20thing--although%20it%20makes%20for%20a%20nicer%20and%20more%20user-friendly%20display--makes%20it%20a%20LOT%20harder%20to%20use%20many%20of%20Excel's%20wonderful%20functions%2C%20which%20can%20extract%20data%20in%20all%20kinds%20of%20neat%20ways%20from%20a%20well-designed%20database.%20So%20if%20you're%20in%20a%20position%20to%20modify%20the%20way%20this%20is%20designed%20in%20the%20first%20place%2C%20we%20may%20be%20able%20to%20make%20some%20really%20effective%20changes.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1247835%22%20slang%3D%22en-US%22%3ERe%3A%20Returning%20a%20value%20from%20a%20discontinuous%20range%20(a%20formatted%20calendar%20with%20data)%20for%20a%20specific%20dat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1247835%22%20slang%3D%22en-US%22%3E%3CP%3EHmmmm%2C%20I%20attached%20a%20file%2C%20or%20so%20I%20thought.%20I'll%20try%20again%20here%20-%20done%2C%20but%20I%20don't%20see%20it%20....%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20don't%20want%20to%20change%20the%20calendar%20layout%2C%20for%20user%20best%20interaction%2C%20plus%20the%20time%20I%20have%20into%20it.%26nbsp%3B%20As%20I%20mentioned%2C%20I%20can%20already%20%22build%22%20the%20sheet%20reference%20from%20my%20input%20date%2C%20so%20getting%20to%20the%20correct%20page%20is%20fine.%20Just%20need%20to%20know%20how%20to%20search%20thru%20the%20range.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3ERight%20now%20I'm%20experimenting%20with%20row%20and%20column%20generation%2C%20using%20help%20from%20here%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fexceljet.net%2Fformula%2Fget-location-of-value-in-2d-array%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fexceljet.net%2Fformula%2Fget-location-of-value-in-2d-array%3C%2FA%3E%26nbsp%3B.%26nbsp%3B%20Having%20some%20success%2C%20but%20a%20bit%20cumbersome.%20Still...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1247914%22%20slang%3D%22en-US%22%3ERe%3A%20Returning%20a%20value%20from%20a%20discontinuous%20range%20(a%20formatted%20calendar%20with%20data)%20for%20a%20specific%20dat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1247914%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F591297%22%20target%3D%22_blank%22%3E%40Rapid_Ron_L%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20file%20should%20attach%20if%20you%20drag%20it%20to%20the%20area%20below%20the%20purple%20bar%2C%20where%20you%20enter%20your%20own%20message.%20See%20below%20for%20an%20image%20from%20this%20message%20I'm%20typing.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mathetes_0-1584996751665.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F178988iE2B511AF99FC2519%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22mathetes_0-1584996751665.png%22%20alt%3D%22mathetes_0-1584996751665.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1247927%22%20slang%3D%22en-US%22%3ERe%3A%20Returning%20a%20value%20from%20a%20discontinuous%20range%20(a%20formatted%20calendar%20with%20data)%20for%20a%20specific%20dat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1247927%22%20slang%3D%22en-US%22%3E%3CP%3EI%20did%20that%2C%20and%20also%20did%20it%20via%20browser.%20Maybe%20macro%20files%20can't%20be%20attached.%26nbsp%3B%20I'll%20save%20as%20.xlsx%2C%20as%20I%20don't%20think%20there%20are%20any%20macros!%26nbsp%3B%20I%20think%20that%20worked.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1248045%22%20slang%3D%22en-US%22%3ERe%3A%20Returning%20a%20value%20from%20a%20discontinuous%20range%20(a%20formatted%20calendar%20with%20data)%20for%20a%20specific%20dat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1248045%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F591297%22%20target%3D%22_blank%22%3E%40Rapid_Ron_L%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewell%2C%20I%20see%20the%20file%20and%20have%20opened%20it.%20But%20can't%20really%20discern%20from%20your%20description%20what%20it%20is%20you%20want%20to%20do%20with%20this.%20For%20example%2C%20are%20you%20wanting%20to%20do%20proactive%2C%20forward%20looking%20scheduling%2C%20or%20retroactive%20counting%20of%20days%20worked%20per%20employee%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENor%20do%20I%20see%20any%20named%20range%20called%20%22Date%20Range%22%20in%20among%20the%20named%20ranges.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThat%20said%2C%20let%20me%20go%20back%20to%20my%20first%20comment%20(in%20which%20I%20agreed%20with%20your%20assessment)%20that%20it's%20unfortunate%20that%20the%20calendars%20are%20all%20on%20separate%20pages.%20You%20pointed%20out%20that%20this%20is%20%22for%20user%20best%20interaction%22%20which%20is%20what%20I%20expected%20(or%20something%20along%20those%20lines)....%20as%20well%20as%20being%20concerned%20that%20you'd%20already%20put%20so%20much%20time%20into%20it%26nbsp%3B%20The%20latter%2C%20of%20course%2C%20might%20be%20countered%20by%20%22It's%20now%20going%20to%20take%20even%20more%20time%20to%20make%20it%20work%20because%20of%20that%20layout.%22%20And%20the%20former....well%2C%20I%20would%20contend%20that%20user%20interaction%20can%20be%20adaptable.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20fundamental%20point%20being%20that%20although%20maybe%20this%20could%20be%20made%20to%20work%2C%20you're%20ALREADY%20finding%20out%20part%20of%20the%20difficulty%20with%20creating%20%22input%20sheets%22%20that%20are%20user-friendly%20by%20virtue%20of%20being%20laid%20out%20in%20a%20familiar%20(calendar)%20manner....that%20difficulty%20being%20that%20it%20becomes%20unwieldy%20to%20then%20extract%20the%20data%20in%20a%20simple%20way.%20Excel%20is%20excellent%20at%20extracting%20data%20and%20summarizing%20it%20(%20via%20Pivot%20Tables%2C%20etc.)%20when%20that%20%22raw%22%20input%20data%20are%20organized%20in%20a%20Table.%20And%2C%20believe%20it%20or%20not%2C%20Tables%20can%20actually%20become%20user-friendly%3B%20or%20perhaps%20I%20should%20say%2C%20users%20can%20develop%20a%20fondness%20for%20Tables%20once%20they%20get%20acquainted%20with%20them.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt's%20possible%20that%20somebody%20else%20here%20can%20help%20you%20set%20this%20up%20so%20that%20it%20makes%20use%20of%20the%20Input%20Form%20capability%20of%20Excel--I've%20not%20ever%20used%20that%20capability%2C%20but%20always%20developed%20Tables%20that%20can%20then%20become%20the%20basis%20for%20planning%20team%20member%20responsibilities%2C%20ensuring%20coverage%20for%20various%20tasks%2C%20summarizing%20upcoming%20events%2C%20etc.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20do%20think%20that%20anybody%20wanting%20to%20help%2C%20though%2C%20is%20going%20to%20need%20a%20bit%20more%20of%20a%20definition%20of%20how%20the%20data%20in%20each%20day%20is%20to%20be%20used.%20What%20you%20said%20in%20your%20first%20posting%20was%20%22This%20fetches%20the%20manpower%20count%20from%20the%20calendar%20to%20use%20against%20the%20needs%20for%20each%20day%22%20making%20it%20sound%20as%20if%20you%20are%20forward%20looking.%20In%20the%20spreadsheet%20itself%2C%20however%2C%20the%20legend%20in%20the%20yellow%20box%20with%20the%20names%20reads%20%22enter%20all%20employee%20names%20below%20one%20per%20line%20then%20copy%20and%20paste%20all%20to%20each%20day%2C%20then%20individually%20delete%20absentees%20from%20each%20day%22%20making%20it%20sound%20as%20if%20it%20is%20looking%20backwards%20(i.e.%2C%20they%20haven't%20been%20absent%20until%20it's%20happened%2C%20even%20if%20it%20was%20just%20%22today%22%2C%20so%20it's%20more%20of%20a%20tracker%20for%20actual%20experience%20rather%20than%20a%20projection%20of%20staffing%20against%20need.%20%3CEM%3EWhich%20is%20it%3F%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20that%20aside%2C%20I%20just%20see%20this%20as%20not%20having%20the%20flexibility%20to%20handle%20the%20inevitable%20staff%20changes%20mid-year%2C%20whereas%20a%20%22simple%22%20well%20designed%20Table%20for%20input%2C%20with%20a%20Pivot%20Table%20for%20output%20(to%20report%20how%20many%20days%20by%20month%20each%20employee%20worked%2C%20for%20example)%2C%20would%20inherently%20and%20easily%20handle%20matters%20of%20turnover%2C%20new%20hires%2C%20and%20so%20on.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20I%20don't%20mean%20to%20give%20you%20a%20hard%20time%3B%20just%20to%20suggest%20that%20you%20give%20some%20more%20thought%20to%20re-thinking%20how%20you've%20laid%20it%20out.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20I%20will%20be%20happy%20for%20you%20if%20somebody%20else%20comes%20along%20and%20helps%20you%20solve%20your%20problem%20with%20far%20less%20re-design.%20Truly.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1248177%22%20slang%3D%22en-US%22%3ERe%3A%20Returning%20a%20value%20from%20a%20discontinuous%20range%20(a%20formatted%20calendar%20with%20data)%20for%20a%20specific%20dat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1248177%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F591297%22%20target%3D%22_blank%22%3E%40Rapid_Ron_L%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20for%20one%20month%20only%20return%20the%20list%20for%20given%20date%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20249px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F179016i2654AD418A175DE7%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Ewith%20newly%20introduced%20LET()%20function%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3DLET(%0A%20%20%20MonthRange%2C%24B%246%3A%24H%2477%2C%0A%20%20%20AllDays%2CINDEX(MonthRange%2C(INT(SEQUENCE(6*7%2C%2C7)%2F7)-1)*12%2B1%2CMOD(SEQUENCE(6*7)-1%2C7)%2B1)%2C%0A%20%20%20DatePosition%2CXMATCH(%24O%243%2CAllDays%2C0)%2C%0A%20%20%20DateRow%2C(INT(DatePosition%2F7))*12%2B1%2C%0A%20%20%20DateColumn%2CMOD(DatePosition-1%2C7)%2B1%2C%0A%20%20%20DateValues%2CINDEX(MonthRange%2CDateRow%2B1%2CDateColumn)%3AINDEX(MonthRange%2CDateRow%2B10%2CDateColumn)%2C%0A%20%20%20DateValuesFiltered%2CIFERROR(FILTER(DateValues%2CDateValues%26lt%3B%26gt%3B0)%2C%22%22)%2C%0A%20%20%20DateValuesFiltered%0A)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Ewithout%20it%20by%20with%20dynamic%20arrays%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3DIFERROR(%0A%20%20%20FILTER(%0A%20%20%20%20%20%20INDEX(%24B%246%3A%24H%2477%2C%0A%20%20%20%20%20%20%20%20%20(INT(XMATCH(%24O%243%2CINDEX(%24B%246%3A%24H%2477%2C(INT(SEQUENCE(6*7%2C%2C7)%2F7)-1)*12%2B1%2CMOD(SEQUENCE(6*7)-1%2C7)%2B1)%2C0)%2F7))*12%2B1%2B1%2C%0A%20%20%20%20%20%20%20%20%20MOD(XMATCH(%24O%243%2CINDEX(%24B%246%3A%24H%2477%2C(INT(SEQUENCE(6*7%2C%2C7)%2F7)-1)*12%2B1%2CMOD(SEQUENCE(6*7)-1%2C7)%2B1)%2C0)-1%2C7)%2B1)%3A%0A%20%20%20%20%20%20INDEX(%24B%246%3A%24H%2477%2C%0A%20%20%20%20%20%20%20%20%20(INT(XMATCH(%24O%243%2CINDEX(%24B%246%3A%24H%2477%2C(INT(SEQUENCE(6*7%2C%2C7)%2F7)-1)*12%2B1%2CMOD(SEQUENCE(6*7)-1%2C7)%2B1)%2C0)%2F7))*12%2B1%2B10%2C%0A%20%20%20%20%20%20%20%20%20MOD(XMATCH(%24O%243%2CINDEX(%24B%246%3A%24H%2477%2C(INT(SEQUENCE(6*7%2C%2C7)%2F7)-1)*12%2B1%2CMOD(SEQUENCE(6*7)-1%2C7)%2B1)%2C0)-1%2C7)%2B1)%2C%0A%20%20%20%20%20%20INDEX(%24B%246%3A%24H%2477%2C%0A%20%20%20%20%20%20%20%20%20(INT(XMATCH(%24O%243%2CINDEX(%24B%246%3A%24H%2477%2C(INT(SEQUENCE(6*7%2C%2C7)%2F7)-1)*12%2B1%2CMOD(SEQUENCE(6*7)-1%2C7)%2B1)%2C0)%2F7))*12%2B1%2B1%2C%0A%20%20%20%20%20%20%20%20%20MOD(XMATCH(%24O%243%2CINDEX(%24B%246%3A%24H%2477%2C(INT(SEQUENCE(6*7%2C%2C7)%2F7)-1)*12%2B1%2CMOD(SEQUENCE(6*7)-1%2C7)%2B1)%2C0)-1%2C7)%2B1)%3A%0A%20%20%20%20%20%20INDEX(%24B%246%3A%24H%2477%2C%0A%20%20%20%20%20%20%20%20%20(INT(XMATCH(%24O%243%2CINDEX(%24B%246%3A%24H%2477%2C(INT(SEQUENCE(6*7%2C%2C7)%2F7)-1)*12%2B1%2CMOD(SEQUENCE(6*7)-1%2C7)%2B1)%2C0)%2F7))*12%2B1%2B10%2C%0A%20%20%20%20%20%20%20%20%20MOD(XMATCH(%24O%243%2CINDEX(%24B%246%3A%24H%2477%2C(INT(SEQUENCE(6*7%2C%2C7)%2F7)-1)*12%2B1%2CMOD(SEQUENCE(6*7)-1%2C7)%2B1)%2C0)-1%2C7)%2B1)%26lt%3B%26gt%3B0%0A%20%20%20)%2C%0A%22%22)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1248231%22%20slang%3D%22en-US%22%3ERe%3A%20Returning%20a%20value%20from%20a%20discontinuous%20range%20(a%20formatted%20calendar%20with%20data)%20for%20a%20specific%20dat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1248231%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%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20the%20sake%20of%20the%20rest%20of%20us%20(well%2C%20maybe%20just%20me)%2C%20Sergei%2C%20could%20you%20explain%20those%20two%20formulas%2C%20and%20how%20they're%20working%2C%20what%20they%20do%3F%20I%20don't%20know%20how%20you%20come%20up%20with%20them%20for%20something%20like%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1248236%22%20slang%3D%22en-US%22%3ERe%3A%20Returning%20a%20value%20from%20a%20discontinuous%20range%20(a%20formatted%20calendar%20with%20data)%20for%20a%20specific%20dat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1248236%22%20slang%3D%22en-US%22%3E%3CP%3EWell%2C%20I've%20got%20it%20all%20working!%20Even%20with%20separate%20tabbed%20calendar%20sheets%20and%20different%20calendar%20files%20for%20each%20year.%20I'm%20pressed%20for%20time%20right%20now%2C%20so%20I'll%20evaluate%20the%20above%20feedback%20and%20report%20on%20how%20I%20did%20it%20in%20a%20bit.%20Thanks%20all%2C%20and%20forgive%20my%20non-immediate%20follow-up%20(to%20come).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1248271%22%20slang%3D%22en-US%22%3ERe%3A%20Returning%20a%20value%20from%20a%20discontinuous%20range%20(a%20formatted%20calendar%20with%20data)%20for%20a%20specific%20dat%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1248271%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F425987%22%20target%3D%22_blank%22%3E%40mathetes%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20core%20of%20the%20formula%20is%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EINDEX(MonthRange%2C(INT(SEQUENCE(6*7%2C%2C7)%2F7)-1)*12%2B1%2CMOD(SEQUENCE(6*7)-1%2C7)%2B1)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Ewhich%20returns%20all%20dates%20in%20the%20month%20as%201D%20array.%3C%2FP%3E%0A%3CP%3ELet%20say%20we%20have%20such%20range%20and%20would%20like%20to%20return%20all%20values%20in%20yellow%20sequentially%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20616px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F179024i00204A86EF810245%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThe%20rest%20is%20just%20arithmetic.%20Finding%20relative%20position%20of%20the%20value%20in%20such%20array%20(e.g.%205%20for%20a15)%20and%20knowing%20number%20of%20cells%20in%20each%20row%20and%20step%20between%20row%20with%20MOD%20and%20INT%20we%20find%20position%20of%20this%20value%20in%20source%20range%20(5th%20row%2C%20second%20column).%20INDEX(range%2C5%2C2%2B1)%3AINDEX(range%2C5%2C2%2B1%2B3)%20returns%20values%20for%203%20cells%20under%20found%20one.%20Filter%20result%20if%20necessary.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAll%20above%20steps%20much%20easier%20to%20code%20with%20LET().%20If%20not%20available%2C%20with%20named%20ranges%20and%20formulas.%20Or%20straightforward%20code%20as%20in%20second%20formula.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Using the date in the cell above this formula I need to find the value in a cell 11 rows below the date in a formatted calendar. The calendar is lain out in multiple rows of dates, arranged by week (from a calendar template I borrowed). I've assigned the name "Date_Range" to the discontinuous range of dates on the calendar. I've fiddled around with Index-Match formulas with no success ...

 

Can anyone throw me a life preserver? 

 

p.s. This fetches the manpower count from the calendar to use against the needs for each day. To complicate matters, the calendar is in a different file and each month of the calendar is on a different sheet. I know how to use external file references and indirect to get to the the file name and sheet.

9 Replies
Highlighted

@Rapid_Ron_L 

 

Is it at all possible for you to upload the actual files (after anonomysing any names). Your description is reasonably good, but you'd still be lucky if anybody could create a functioning formula just from that. The actual spreadsheet(s) would also be better than images....

 

P.S. you're certainly right that having each month's calendar on a separate sheet is a major complicating factor. Are you in a position to make major changes to how the data are laid out? That kind of thing--although it makes for a nicer and more user-friendly display--makes it a LOT harder to use many of Excel's wonderful functions, which can extract data in all kinds of neat ways from a well-designed database. So if you're in a position to modify the way this is designed in the first place, we may be able to make some really effective changes.

Highlighted

Hmmmm, I attached a file, or so I thought. I'll try again here - done, but I don't see it ....

 

I don't want to change the calendar layout, for user best interaction, plus the time I have into it.  As I mentioned, I can already "build" the sheet reference from my input date, so getting to the correct page is fine. Just need to know how to search thru the range.  

Right now I'm experimenting with row and column generation, using help from here: https://exceljet.net/formula/get-location-of-value-in-2d-array .  Having some success, but a bit cumbersome. Still...

Highlighted

@Rapid_Ron_L 

 

The file should attach if you drag it to the area below the purple bar, where you enter your own message. See below for an image from this message I'm typing.

mathetes_0-1584996751665.png

 

Highlighted

I did that, and also did it via browser. Maybe macro files can't be attached.  I'll save as .xlsx, as I don't think there are any macros!  I think that worked.

Highlighted

@Rapid_Ron_L 

 

well, I see the file and have opened it. But can't really discern from your description what it is you want to do with this. For example, are you wanting to do proactive, forward looking scheduling, or retroactive counting of days worked per employee?

 

Nor do I see any named range called "Date Range" in among the named ranges.

 

That said, let me go back to my first comment (in which I agreed with your assessment) that it's unfortunate that the calendars are all on separate pages. You pointed out that this is "for user best interaction" which is what I expected (or something along those lines).... as well as being concerned that you'd already put so much time into it  The latter, of course, might be countered by "It's now going to take even more time to make it work because of that layout." And the former....well, I would contend that user interaction can be adaptable.

 

The fundamental point being that although maybe this could be made to work, you're ALREADY finding out part of the difficulty with creating "input sheets" that are user-friendly by virtue of being laid out in a familiar (calendar) manner....that difficulty being that it becomes unwieldy to then extract the data in a simple way. Excel is excellent at extracting data and summarizing it ( via Pivot Tables, etc.) when that "raw" input data are organized in a Table. And, believe it or not, Tables can actually become user-friendly; or perhaps I should say, users can develop a fondness for Tables once they get acquainted with them.

 

It's possible that somebody else here can help you set this up so that it makes use of the Input Form capability of Excel--I've not ever used that capability, but always developed Tables that can then become the basis for planning team member responsibilities, ensuring coverage for various tasks, summarizing upcoming events, etc.

 

I do think that anybody wanting to help, though, is going to need a bit more of a definition of how the data in each day is to be used. What you said in your first posting was "This fetches the manpower count from the calendar to use against the needs for each day" making it sound as if you are forward looking. In the spreadsheet itself, however, the legend in the yellow box with the names reads "enter all employee names below one per line then copy and paste all to each day, then individually delete absentees from each day" making it sound as if it is looking backwards (i.e., they haven't been absent until it's happened, even if it was just "today", so it's more of a tracker for actual experience rather than a projection of staffing against need. Which is it?

 

But that aside, I just see this as not having the flexibility to handle the inevitable staff changes mid-year, whereas a "simple" well designed Table for input, with a Pivot Table for output (to report how many days by month each employee worked, for example), would inherently and easily handle matters of turnover, new hires, and so on.

 

So I don't mean to give you a hard time; just to suggest that you give some more thought to re-thinking how you've laid it out.

 

And I will be happy for you if somebody else comes along and helps you solve your problem with far less re-design. Truly.

Highlighted

@Rapid_Ron_L 

If for one month only return the list for given date

image.png

with newly introduced LET() function

=LET(
   MonthRange,$B$6:$H$77,
   AllDays,INDEX(MonthRange,(INT(SEQUENCE(6*7,,7)/7)-1)*12+1,MOD(SEQUENCE(6*7)-1,7)+1),
   DatePosition,XMATCH($O$3,AllDays,0),
   DateRow,(INT(DatePosition/7))*12+1,
   DateColumn,MOD(DatePosition-1,7)+1,
   DateValues,INDEX(MonthRange,DateRow+1,DateColumn):INDEX(MonthRange,DateRow+10,DateColumn),
   DateValuesFiltered,IFERROR(FILTER(DateValues,DateValues<>0),""),
   DateValuesFiltered
)

without it by with dynamic arrays

=IFERROR(
   FILTER(
      INDEX($B$6:$H$77,
         (INT(XMATCH($O$3,INDEX($B$6:$H$77,(INT(SEQUENCE(6*7,,7)/7)-1)*12+1,MOD(SEQUENCE(6*7)-1,7)+1),0)/7))*12+1+1,
         MOD(XMATCH($O$3,INDEX($B$6:$H$77,(INT(SEQUENCE(6*7,,7)/7)-1)*12+1,MOD(SEQUENCE(6*7)-1,7)+1),0)-1,7)+1):
      INDEX($B$6:$H$77,
         (INT(XMATCH($O$3,INDEX($B$6:$H$77,(INT(SEQUENCE(6*7,,7)/7)-1)*12+1,MOD(SEQUENCE(6*7)-1,7)+1),0)/7))*12+1+10,
         MOD(XMATCH($O$3,INDEX($B$6:$H$77,(INT(SEQUENCE(6*7,,7)/7)-1)*12+1,MOD(SEQUENCE(6*7)-1,7)+1),0)-1,7)+1),
      INDEX($B$6:$H$77,
         (INT(XMATCH($O$3,INDEX($B$6:$H$77,(INT(SEQUENCE(6*7,,7)/7)-1)*12+1,MOD(SEQUENCE(6*7)-1,7)+1),0)/7))*12+1+1,
         MOD(XMATCH($O$3,INDEX($B$6:$H$77,(INT(SEQUENCE(6*7,,7)/7)-1)*12+1,MOD(SEQUENCE(6*7)-1,7)+1),0)-1,7)+1):
      INDEX($B$6:$H$77,
         (INT(XMATCH($O$3,INDEX($B$6:$H$77,(INT(SEQUENCE(6*7,,7)/7)-1)*12+1,MOD(SEQUENCE(6*7)-1,7)+1),0)/7))*12+1+10,
         MOD(XMATCH($O$3,INDEX($B$6:$H$77,(INT(SEQUENCE(6*7,,7)/7)-1)*12+1,MOD(SEQUENCE(6*7)-1,7)+1),0)-1,7)+1)<>0
   ),
"")
Highlighted

@Sergei Baklan 

 

For the sake of the rest of us (well, maybe just me), Sergei, could you explain those two formulas, and how they're working, what they do? I don't know how you come up with them for something like this.

 

Highlighted

Well, I've got it all working! Even with separate tabbed calendar sheets and different calendar files for each year. I'm pressed for time right now, so I'll evaluate the above feedback and report on how I did it in a bit. Thanks all, and forgive my non-immediate follow-up (to come).

Highlighted

@mathetes 

The core of the formula is

INDEX(MonthRange,(INT(SEQUENCE(6*7,,7)/7)-1)*12+1,MOD(SEQUENCE(6*7)-1,7)+1)

which returns all dates in the month as 1D array.

Let say we have such range and would like to return all values in yellow sequentially:

image.png

The rest is just arithmetic. Finding relative position of the value in such array (e.g. 5 for a15) and knowing number of cells in each row and step between row with MOD and INT we find position of this value in source range (5th row, second column). INDEX(range,5,2+1):INDEX(range,5,2+1+3) returns values for 3 cells under found one. Filter result if necessary.

 

All above steps much easier to code with LET(). If not available, with named ranges and formulas. Or straightforward code as in second formula.