Excel Formula Help

%3CLINGO-SUB%20id%3D%22lingo-sub-1549842%22%20slang%3D%22en-US%22%3EExcel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1549842%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3B%20I%20am%20using%20a%20lookup%20formula%20to%20get%20the%20last%20date%20of%20any%20reference%20number%20and%20then%20add%20one%20sec%20to%20it...%3CBR%20%2F%3E%3DIF(D10%3D%22New%20Addition%22%2CE10%2CLOOKUP(3%2C(1%2F(%24C%244%3A%24C%2454%3DC10)%2B(1%2F%24G%244%3A%24G%2454%26lt%3B%26gt%3B%22%22))%2C%24G%244%3A%24G%2454)%2B1%2F86400)%3CBR%20%2F%3EIts%20is%20doing%20good...%20What%20I%20need%20is%20to%20restrict%20this%20function%20to%20cells%20in%20column%20before%20cell%20formula%20is%20running...%20Example%3A%20formula%20has%20to%20look%20at%20C10%20and%20get%20max%20date%3B%20it%20will%20only%20use%20data%20from%20C4%3AC9...%20Data%26nbsp%3Bbelow%20it%2C%20don't%20want%20to%20use...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1549842%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1550077%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1550077%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F742188%22%20target%3D%22_blank%22%3E%40shahzad_afzal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20clearly%20know%20about%20absolute%20and%20relative%20cell%20references%2C%20which%20would%20be%20part%20of%20the%20answer.%20But%20what%20do%20you%20do%20if%20you're%20in%20Cell%20C345%3F%20Is%20there%20always%20only%20a%20difference%20of%205%20rows%20between%20the%20start%20and%20finish%20row%20for%20that%20formula%20you're%20asking%20about.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20other%20words%2C%20what%20we%20need%20from%20you%20is%20a%20bit%20more%20information%20on%20the%20larger%20context%20here...how%20is%20the%20table%20being%20built%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBy%20the%20way%2C%20another%26nbsp%3B%20(and%20I%20think%20clearer)%20way%20to%20add%20a%20second%20to%20the%20value%20of%20another%20date%26amp%3Btime%20cell%20is%20to%20use%20%3CSTRONG%3E%2BTIME(0%2C0%2C1)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1550492%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1550492%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%3BI%20am%20attaching%20a%20test%20case%20for%20you%20to%20review...%3C%2FP%3E%3CP%3EWhen%20you%20sort%20data%20with%20the%20date%20which%20I%20have%20to%2C%20every%20thing%20will%20get%20disturbed...%3C%2FP%3E%3CP%3EI%20just%20want%20the%20highest%20date%20till%20the%20selected%20row%20and%20not%20after%20that%20to%20be%20used%20to%20get%20dates%3B%20else%20every%20time%3B%20highest%20date%20is%20displayed%20from%20the%20column...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1551041%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1551041%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F742188%22%20target%3D%22_blank%22%3E%40shahzad_afzal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20not%20following%20you%20at%20all...that%20is%2C%20I%20don't%20understand%20what%20you're%20trying%20to%20do%20with%20the%20sample%20spreadsheet%3B%20your%20words%20in%20this%20last%20post%20don't%20fully%20make%20sense%20either.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3EWhen%20you%20sort%20data%20with%20the%20date%20which%20I%20have%20to%2C%20every%20thing%20will%20get%20disturbed...%3C%2FEM%3E%3C%2FP%3E%3CUL%3E%3CLI%3ESort%3F%3C%2FLI%3E%3CLI%3ESort%20data%20with%20the%20date%20which%20I%20have%20to%3F%20(%22have%20to%22%20meaning%20%22must%20do%22%3F)%3C%2FLI%3E%3CLI%3Eeverything%20will%20get%20disturbed%3F%20(supposed%20to%20get%20disturbed%3B%20will%20in%20the%20course%20of%20%22sorting%22)%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3EI%20just%20want%20the%20highest%20date%20till%20the%20selected%20row%20and%20not%20after%20that%20to%20be%20used%20to%20get%20dates%3B%20else%20every%20time%3B%20highest%20date%20is%20displayed%20from%20the%20column...%3C%2FEM%3E%3C%2FP%3E%3CUL%3E%3CLI%3EWhich%20column(s)%20are%20you%20referring%20to%3F%20There%20are%20five%20columns%20in%20your%20example%3B%20three%20of%20them%20are%20dates%20AND%20times.%3C%2FLI%3E%3CLI%3EWhat%20is%20supposed%20to%20happen%20with%20column%20E%3F%20How%20do%20column%20D%20and%20F%20affect%20that.%3CUL%3E%3CLI%3EPlease%20answer%20that%20question%20in%20words....I%20know%20that's%20what%20your%20formula%20is%20trying%20to%20do%2C%20and%20it's%20what%20your%20question%20is%20about.%20But%20spell%20it%20out%20more%20completely.%3C%2FLI%3E%3C%2FUL%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1551100%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1551100%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%3Bsorry%20for%20the%20confusions...%3C%2FP%3E%3CP%3EColumn%20E%20will%20have%20two%20type%20of%20dates%3B%20one%20if%20new%20addition%20and%20date%20will%20come%20from%20Column%20D...%20When%20activity%20ends%3B%20next%20time%20will%20have%20one%20second%20addition...%20Column%20E%20will%20get%20date%20%26amp%3B%20time%20from%20Column%20D%20for%20all%20activities%20other%20than%20new%20addition...%3C%2FP%3E%3CP%3ENow%20come%20to%20Column%20B%20%26amp%3B%20Row%2010%3B%20ABC2000078304...%20If%20i%20will%20copy%20paste%20formula%3B%20i%20will%20get%20highest%20date%20from%20column%20F%20which%20is%20F17%20Cell...%20I%20want%20it%20to%20get%20date%20with%20reference%20to%20cell%20F10%20only...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20this%20makes%20sense...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1551156%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1551156%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F742188%22%20target%3D%22_blank%22%3E%40shahzad_afzal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESorry.%20Still%20not%20making%20sense.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWalk%20me%20though%20what's%20happening%20in%20each%20column%20in%20rows%209%20through%2019.%3C%2FP%3E%3CUL%3E%3CLI%3EThe%20two%20entries%20%22New%20Addition%22%20and%20%22Termination%22%20make%20sense.%3C%2FLI%3E%3CLI%3EWhat%20does%20%22Locked%22%20mean%3F%20what%20does%20%22Active%22%20mean%3F%3C%2FLI%3E%3CLI%3EAnd%20how%20does%20each%20event%20affect%20the%20various%20time%20stamps%3F%3C%2FLI%3E%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1551202%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1551202%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%3BA%20customer%20joined%20on%20new%20addition...%20After%20some%20time%3B%20customer%20wants%20to%20lock%20his%20internet%20link%20or%20terminate%20when%20not%20needed...%20Scenario%201%3B%20customer%20ID%20ABC2000078304%20(Cell%20B9)%3B%20came%20on%20network...%20Stayed%20active%20from%2012th%20Mar%20till%2016th%20Mar%20and%20went%20to%20lock...%3C%2FP%3E%3CP%3EThe%20moment%20i%20run%20lookup%3B%20E10%20will%20get%20date%20from%20F17%20which%20is%20the%20highest%20date%20in%20the%20column...%20It%20has%20to%20be%2016th%20Mar%20not%2025th%20Mar...%3C%2FP%3E%3CP%3EJust%20copy%20paste%20formula%20from%20E5%20onwards%20till%20E28%2C%20you%20will%20see%20that%20column%20E%20will%20get%20populated%20with%20highest%20date%20record%20from%20column%20F...%3C%2FP%3E%3CP%3EI%20want%20ABC2000078304%20related%20record%2C%20whatever%20row%20number%20it%20is%3B%20will%20get%20date%20from%20the%20previous%20record%20only%2C%20rather%20than%20max%20date%20from%20column%20F...%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1551398%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1551398%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F742188%22%20target%3D%22_blank%22%3E%40shahzad_afzal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20know%20it's%20clear%20in%20your%20mind.%20It's%20not%20in%20mine.%20A%20big%20part%20of%20the%20confusion%20in%20my%20mind%20is%20(I%20think)%20caused%20by%20Column%20E%20apparently%20being%20the%20final%20or%20more%20important%20part%20of%20the%20record%2C%20yet%20appearing%20between%20D%20and%20F...so%20it's%20that%20relationship%20and%20your%20reference%20to%20rows%20that%20appear%20to%20FOLLOW%20rather%20than%20precede%20(like%20why%20does%20E10%20get%20a%20date%20from%20F17%3F)...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELet%20me%20ask%20again%2C%20and%20I'll%20not%20confuse%20it%20by%20asking%20subordinate%20questions%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3ERow%20by%20row%2C%20what's%20happening%3F%20Walk%20me%20though%20what's%20happening%20in%20each%20column%2C%20especially%20E%2C%20in%20each%20of%20the%20rows%2C%209%20through%2019.%3CBR%20%2F%3E%3C%2FEM%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1551463%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1551463%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%3BRow%209%3B%20a%20new%20addition%20of%20customer%20number%20ABC2000078304...%20Manual%20entry%20of%20Date%20in%20Column%20D...%20In%20column%20E%2C%20it%20will%20get%20date%20from%20D%20as%20its%20a%20new%20addition...%3C%2FP%3E%3CP%3EAfter%204%20days%3B%20customer%20decided%20to%20lock%20it%20link%20temporary%20for%20any%20reason%3B%20a%20manual%20entry%20in%20column%20F...%3C%2FP%3E%3CP%3EAs%20the%20status%20changed%20to%20Locked%3B%20added%20a%20new%20row%20to%20show%20customer%20went%20to%20lock%20and%20will%20stay%20in%20lock%20till%20the%20time%20a%20manual%20entry%20of%20activity%20end%20is%20added%20in%20column%20F%20against%20it...%3C%2FP%3E%3CP%3EAfter%20less%20than%201%20hour%3B%20customer%20decided%20to%20be%20active%20again...%20Added%20a%20manual%20entry%20and%20activity%20of%20lock%20ended%20and%20customer%20moved%20to%20active%20state%20in%20row%2011...%20same%20type%20of%20lock%20and%20active%20state%20will%20go%20on%20till%20the%20time%20customer%20decided%20in%20row%2018%20to%20terminate%20the%20link%20on%2025th%20Mar...%20Active%20status%20ends%20with%20a%20manual%20entry%20in%20F17%20and%20shows%20being%20terminated%20in%20E18...%3C%2FP%3E%3CP%3E1%20Sec%20is%20a%20system%20delay%20to%20process%20the%20request...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I%20run%20the%20lookup%20formula%3B%20like%20I%20shared%20in%20my%20first%20message%3B%20excel%20will%20get%2025th%20mar%20date%20in%20E10%20as%20the%20maximum%20date%20of%20any%20customer%20whereas%20I%20need%20the%20date%20of%20last%20instance%20in%20E10%20which%20is%2016th%20Mar%205%3A59%3A56...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20this%20is%20clear%20now...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1552785%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1552785%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F742188%22%20target%3D%22_blank%22%3E%40shahzad_afzal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20wrote%3A%20Hope%20this%20is%20clear%20now...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20it's%20not%20quite.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20particular.%20when%20you%20say%20%3CEM%3EIf%20I%20run%20the%20lookup%20formula%20...%20excel%20will%20get%2025th%20mar%20date%20in%20E10%20as%20the%20maximum%20date%20of%20any%20customer%20whereas%20I%20need%20the%20date%20of%20last%20instance%20in%20E10%20which%20is%2016th%20Mar%205%3A59%3A56...%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20as%20I%20look%20at%20your%20sheet%2C%20the%20value%20in%20E10%20is%20March%2016%2C%202020%205%3A59%3A57%3B%20the%20value%20you%20cite%20as%20what%20you%20need%20is%20in%20D9%20(the%20cell%20that%20feeds%20E10)%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20So%20which%20is%20it%20that%20you%20need%3F%20And%2C%20more%20importantly%20for%20writing%20the%20formula%2C%20why%20is%20it%20that%20cell%3F%20What%20distinguishes%20it%3F%20You%20say%20it's%20%22the%20last%20instance%22%2C%20but%20%22last%20instance%20of%20what%22%3F%20precisely.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELet%20me%20re-raise%20a%20question%20I%20asked%20you%20early%20yesterday%3A%26nbsp%3B%20if%20I%20go%20back%20to%20your%20second%20message%20yesterday%20you%20said%20something%20that%20I%20questioned%20at%20the%20time.%20I%20need%20to%20ask%20again.%20You%20wrote%3A%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CEM%3EWhen%20you%3CFONT%20color%3D%22%23FF0000%22%3E%3CSTRONG%3E%20sort%20data%3C%2FSTRONG%3E%3C%2FFONT%3E%20with%20the%20date%20%3CFONT%20color%3D%22%23FF0000%22%3Ewhich%20I%20have%20to%3C%2FFONT%3E%2C%20every%20thing%20will%20get%20disturbed...%3C%2FEM%3E%3C%2FP%3E%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CEM%3EI%20just%20want%20the%20highest%20date%20till%20the%20selected%20row%20and%20not%20after%20that%20to%20be%20used%20to%20get%20dates%3B%20else%20every%20time%3B%20highest%20date%20is%20displayed%20from%20the%20column...%3C%2FEM%3E%3C%2FP%3E%3CP%3EIt%20is%20now%20striking%20me%20that%20maybe%20a%20big%20part%20of%20the%20confusion%20here%2C%20in%20what%20you're%20saying%20AND%20in%20the%20procedure%20itself%20that%20you're%20following%2C%20is%20that%20you%20routinely%20sort%20this%20table%2C%20from%20appearances%20the%20San%20ID%20column%20(column%20B)%20is%20the%20primary%20sort%2C%20and%20Activity%20Start%20is%20the%20secondary%20sort.%20%3CSTRONG%3E%3CU%3EIs%20that%20the%20case%3F%20Do%20you%20enter%20new%20event%20data%20at%20the%20bottom%20of%20the%20table%20and%20then%20sort%3F%3C%2FU%3E%3C%2FSTRONG%3E%20That%20could%20indeed%20have%20the%20effect%20you%20describe%3A%20%22everything%20will%20get%20disturbed.%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CU%3E%3CSTRONG%3EIf%20that's%20the%20case%2C%20the%20solution%20would%20be%2C%20first%2C%20to%20separate%20the%26nbsp%3B%20procedure%20by%20which%20you%20collect%20the%20event%20data%20from%20the%20procedure%20by%20which%20you%20display%20it.%20Said%20another%20way%2C%20to%20distinguish%20between%20input%20and%20output.%3C%2FSTRONG%3E%3C%2FU%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20reason%3A%20if%20you%20are%20indeed%20sorting%20this%20table%20routinely%2C%20that%20will%20disturb%20the%20relationships%20between%20rows%2C%20as%20things%20get%20rearranged.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20first%20please%20clarify%20that%20aspect%20of%20how%20you%20add%20rows%20(new%20customers%2C%20new%20events)%20to%20this%20table%20in%20the%20first%20place.%20And%20answer%20the%20question%20of%20whether%20or%20not%20it%20gets%20sorted%20so%20as%20to%20distinguish%20between%20customers.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1553173%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1553173%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F742188%22%20target%3D%22_blank%22%3E%40shahzad_afzal%3C%2FA%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BI%20think%20I%20understand%20what%20is%20trying%20to%20be%20done%20here.%26nbsp%3B%20I%20agree%20with%26nbsp%3B%26nbsp%3B%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%3Bthat%20it%20might%20be%20a%20good%20practice%20to%20set%20up%20the%20sheet%20as%20a%20database%20input%20sheet%20and%20then%20use%20pivot%20table%20to%20display%20the%20data%20in%20the%20desired%20format.%26nbsp%3B%20But%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F742188%22%20target%3D%22_blank%22%3E%40shahzad_afzal%3C%2FA%3E%26nbsp%3B%20question%20I%20believe%20you%20are%20looking%20for%20the%20formula%20in%20the%20original%20post%20to%20be%20corrected%20to%20work%20and%20that%20would%20be%20to%20use%20partial%20absolute%20and%20relative%20references%20similar%20to%20what%20is%20being%20used%20in%20the%20sample%20sheet%20you%20provided.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3Eso%20in%20the%20sample%20sheet%20row%2010%20you%20have%3A%3C%2FP%3E%3CP%3E%3DIFERROR(IF(C10%3D%22New%20Addition%22%2CD10%2CLOOKUP(B10%2C%24B%244%3A%3CU%3E%3CSTRONG%3EB9%3C%2FSTRONG%3E%3C%2FU%3E%3CSPAN%3E%2C%24F%244%3A%3CU%3E%3CSTRONG%3EF9%3C%2FSTRONG%3E%3C%2FU%3E)%2B1%2F86400)%2C%22%22)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Enotice%20how%20it%20has%20absolute%20reference%20for%20%24B%244%20but%20relative%20reference%20for%20B9%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20believe%20you%20want%20to%20switch%20to%20a%20formula%20that%20looks%20like%20the%20one%20you%20posted%20so%20you%20need%20to%20have%20a%20similar%20mix%20of%20absolute%20and%20relative%20references%20(modified%20to%20work%20on%20row%2010%20of%20sample%20sheet)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3DIF(C10%3D%22New%20Addition%22%2CD10%2CLOOKUP(3%2C(1%2F(B%244%3A%3CU%3E%3CSTRONG%3EB9%3C%2FSTRONG%3E%3C%2FU%3E%3DB10)%2B(1%2FF%244%3A%3CU%3E%3CSTRONG%3EF9%3C%2FSTRONG%3E%3C%2FU%3E%26lt%3B%26gt%3B%22%22))%2CF%244%3A%3CU%3E%3CSTRONG%3EF9%3C%2FSTRONG%3E%3C%2FU%3E)%2B1%2F86400)%3C%2FP%3E%3CP%3Ethat%20said%20you%20might%20also%20consider%20another%20variation%20that%20I%20find%20easier%20to%20read%3A%3C%2FP%3E%3CP%3E%3DIF(C10%3D%22New%20Addition%22%2CD10%2CMAXIFS(%24F%243%3A%24F9%2C%24B%243%3A%24B9%2C%24B10)%2BTIME(%2C%2C1))%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20also%20not%20clear%20about%20what%20your%20problem%20actually%20is%20since%20the%20formula%20you%20already%20have%20on%20the%20sheet%20appears%20to%20be%20working%20but%20hopefully%20these%20variations%20might%20help.%26nbsp%3B%20If%20not%20please%20explain%20this%20problem%20with%20sorting%20and%20it%20getting%20mixed%20up.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1553241%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1553241%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3BDear%20Team%3B%20Thanks%20for%20jumping%20in%20to%20help%20me%20out...%20I%20am%20attaching%20version%202%2C%20with%20absolute%20values%20for%20the%20whole%20data...%3C%2FP%3E%3CP%3ELet%20me%20make%20it%20more%20open...%3C%2FP%3E%3CP%3EIs%20this%20possible%20to%20get%20date%20from%20last%20activity%20of%20relative%20SAN%3F%3F%3F%20Whatever%20is%20the%20last%20activity...%3C%2FP%3E%3CP%3EForget%20about%20lookup%20and%20any%20formula%20I%20already%20shared...%20I%20don't%20want%20to%20get%20max%20date%20from%20the%20column%20against%20relative%20SAN%20ID...%20I%20just%20want%20next%20activity%20to%20find%20previous%20activity%2C%20get%20its%20date%20%26amp%3B%20time%20and%20add%201%20sec%20to%20it%20and%20done...%3C%2FP%3E%3CP%3EThere%20will%20be%201000s%20of%20SANs%20with%20multiple%20activities%20daily...%20You%20can%20suggest%20sorting%20type%20too%2C%20either%20SAN%20based%20or%20activity%20date...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1553308%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1553308%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F742188%22%20target%3D%22_blank%22%3E%40shahzad_afzal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20still%20haven't%20answered%20the%20question%20about%20whether%20or%20not%20it%20is%20your%20practice%20to%20sort%20this%20table%20routinely.%20That's%20an%20important%20question.%20Neither%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%20nor%20I%20was%20suggesting%20that%20you%20do%3B%20we're%20asking%20IF%20you%20do.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20it%20appears%20that%20you%20do%2C%20just%20from%20the%20evidence%20that%20SANID%20ABC2000078423%20begins%20activity%20(is%20a%20New%20Addition)%20with%20a%20date%20that%20precedes%20the%20termination%20date%20of%20ABC2000078304.%20So%20you're%20either%20sorting%20OR%20you%20are%20adding%20rows%20by%20insertion.%20Either%20way%2C%20you're%20not%20handling%20this%20as%20a%20neat%20and%20simple%20Excel%20Table%20for%20input.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20kind%20of%20formula%20you%20are%20looking%20for%20is%20an%20easy%20matter.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20it's%20important%20to%20know%20how%20this%20table%20is%20being%20maintained%20from%20the%20point%20of%20view%20of%20data%20entry.%20And%20then%20it%20might%20well%20make%20a%20lot%20of%20sense%20to%20treat%20it%20solely%20as%20a%20data%20entry%20table%20(Input)%2C%20and%20create%20a%20separate%20tab%20that%20extracts%20the%20data%20and%20sorts%20it%20to%20form%20a%26nbsp%3B%20useful%20report%20(Output).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20going%20to%20create%20a%20mockup%20of%20what%20I'm%20describing%20for%20you%20and%20will%20post%20it%20shortly.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1553335%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1553335%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%3BHi%3B%20Data%20entry%20will%20be%20manual%20like%20adding%20new%20addition%20date%3B%20then%20adding%20activity%20end%20date%2C%20which%20will%20help%20to%20get%20next%20activity%20start%20date%20and%20so%20on%20till%20termination...%20I%20would%20love%20to%20sort%20this%20by%20activity%20date%20as%20every%20month%20need%20to%20generate%20a%20month%20activity%20report%20and%20revenue%20report%20out%20of%20it...%20I%20can%20add%20another%20sheet%20and%20can%20use%20VLOOKUP%20to%20get%20new%20addition%20date%20into%20the%20formula...%20Rest%20all%20data%20will%20be%20here...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1553398%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1553398%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F742188%22%20target%3D%22_blank%22%3E%40shahzad_afzal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20wrote%3A%20Data%20entry%20will%20be%20manual%20like%20adding%20new%20addition%20date%3B%20then%20adding%20activity%20end%20date%2C%20which%20will%20help%20to%20get%20next%20activity%20start%20date%20and%20so%20on%20till%20termination...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhich%20doesn't%20yet%20make%20it%20clear.%20Of%20course%20you%20add%20new%20data%20by%20entering%20an%20ID%2C%20an%20activity%20description%2C%20and%20a%20date.%20The%20question%20was%20aimed%20at%20%3CU%3E%3CSTRONG%3E%3CEM%3Ehow%3C%2FEM%3E%20%3C%2FSTRONG%3E%3C%2FU%3Ethe%20table%20is%20maintained%2C%20which%20wasn't%20so%20much%20what%20data%20are%20entered--that's%20pretty%20obvious--but%20whether%20or%20not%20you%20enter%20each%20transaction%20at%20the%20%3CU%3Ebottom%3C%2FU%3E%20of%20the%20table%2C%20regardless%20of%20which%20SAN%20ID%20it%20is%2C%20or%20do%20you%20%3CU%3Einsert%20a%20row%3C%2FU%3E%20in%20the%20section%20for%20the%20given%20SAN%20ID%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELet%20me%20take%20a%20few%20minutes%20to%20create%20a%20mock-up%20for%20how%20transactional%20databases%20are%20generally%20laid%20out%2C%20with%20an%20example%20of%20what%20could%20then%20be%20created%20as%20an%20output%20report.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1553402%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1553402%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F742188%22%20target%3D%22_blank%22%3E%40shahzad_afzal%3C%2FA%3E%26nbsp%3B%20I%20looked%20at%20your%20new%20sample%20sheet%20and%20the%201st%20table%20with%20Absolute%20and%20Relative%20reference%20seems%20to%20do%20what%20you%20want.%26nbsp%3B%20Is%20there%20a%20problem%20with%20that%3F%26nbsp%3B%20I%20still%20don't%20know%20what%20was%20not%20working%20with%20the%20original%20lookup%20(using%20abs%20and%20relative%20references)%20in%20the%20original%20sample%20sheet.%26nbsp%3B%20I%20have%20attached%20a%20sheet%20with%20multiple%20variations%20for%20the%20START%20TIME%20using%20each%20of%20the%20formulas.%26nbsp%3B%20all%20of%20them%20except%20the%20fully%20absolute%20reference%20seem%20to%20work.%26nbsp%3B%20Let%20me%20know%20what%20isn't%20working%20if%20needed%2C%20but%20I%20think%20the%20last%20one%20I%20gave%20is%20the%20most%20'robust'%20solution.%26nbsp%3B%20I%20attached%20the%20file%20and%20included%20an%20conditional%20formatting%20that%20highlights%20any%20START%20TIME%20that%20is%20%26gt%3B%20END%20TIME%20to%20highlight%20problems.%26nbsp%3B%20That%20highlighted%20the%20first%20row%20because%20the%20New%20Addition%20Date%20is%20actually%20after%20the%20END%20TIME.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1553567%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1553567%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F742188%22%20target%3D%22_blank%22%3E%40shahzad_afzal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere's%20a%20totally%20different%20approach.%20It%20uses%20most%20of%20your%20data%20but%20approaches%20it%20by%20separating%20INPUT%20from%20OUTPUT.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20input%20table%20uses%20most%20of%20your%20raw%20data%2C%20but%20simplified%20to%20only%20three%20columns%20and%20they've%20been%20entered%20in%20date%20and%20time%20sequence%3A%3C%2FP%3E%3CUL%3E%3CLI%3EStart%20date%20and%20time%3C%2FLI%3E%3CLI%3ESAN%20ID%3C%2FLI%3E%3CLI%3ETransaction%20(event)%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThen%20I%20use%20two%20formulas%20only%20to%20create%20the%20output.%3C%2FP%3E%3CUL%3E%3CLI%3EThe%20first%20one%20is%20%3CSTRONG%3E%3DSORT(Table1%2C2)%3C%2FSTRONG%3E%20which%20sorts%20the%20input%20table%20on%20the%20basis%20of%20the%20second%20column%2C%20which%20is%20SAN%20ID%26nbsp%3B%26nbsp%3B%20It%20%22spills%22%20down%20to%20populate%20however%20many%20rows%20there%20are%20in%20the%20basic%20input%20table.%20That%20could%20be%20refined%20if%20need%20be%2C%20to%20limit%20it%20in%20various%20ways%2C%20depending%20on%20your%20needs.%20%3CSTRONG%3ESORT%3C%2FSTRONG%3E%20is%20one%20of%20the%20new%20Dynamic%20Array%20functions%2C%20available%20only%20in%20the%20newest%20release%20of%20Excel.%20If%20this%20doesn't%20work%20for%20you%2C%20that's%20why.%3C%2FLI%3E%3CLI%3EThe%20second%20formula%20is%20%3CSTRONG%3E%3DIF(C5%3DC4%2CB5-TIME(0%2C0%2C1)%2C%22%22)%3C%2FSTRONG%3E%20and%20that%20actually%20derives%20the%20end%20time%20from%20the%20start%20time%20of%20the%20NEXT%20activity%20for%20the%20same%20SAN%20ID.%20In%20other%20words%2C%20I've%20reversed%20your%20logic.%20AND%20I%20only%20create%20the%20end%20time%20at%20the%20report%20stage%20of%20things.%20It's%20assumed%20that%20when%20you%20start%20a%20new%20stage%20of%20the%20contract%20with%20a%20given%20SAN%20ID%2C%20that%20it%20means%20the%20last%20stage%20is%20now%20superceded.%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20encourage%20you%20to%20add%20additional%20events%2C%20new%20SANIDs%2C%20at%20the%20bottom%20of%20the%20input%20sheet.%20You'll%20see%20that%20the%20output%20sheet%20will%20automatically%20keep%20up%20with%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1553981%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1553981%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%3BDear%3B%20added%20more%20data%20(see%20attached)%20and%20if%20sorted%20by%20SAN%20ID%2C%20things%20are%20perfect...%3C%2FP%3E%3CP%3ENew%20data%20addition%20will%20always%20be%20in%20the%20last%20row%3B%20what%20is%20the%20possible%20option%20to%20get%20the%20date%20from%20the%20previous%20instance%20without%20sorting%20by%20SAN%20ID%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1554058%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1554058%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F742188%22%20target%3D%22_blank%22%3E%40shahzad_afzal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20to%20ask%20what%20you%20thought%20of%20the%20version%20I%20created.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20also%2C%20whether%20you%20use%20that%20or%20not%2C%20you%20really%20haven't%20ever%20clarified%20what%20the%20whole%20process%20is%20that%20you%20are%20trying%20to%20create.%20It's%20clear%20that%20you're%20capturing%20data%20on%20various%20events%2C%20but%20toward%20what%20purpose%3F%20Does%20a%20report%20sorted%20by%20SAN%20ID%20have%20a%20place%3F%20Would%20it%20be%20better%20to%20just%20extract%20the%20full%20history%20of%20any%20given%20SAN%20ID%3F%20Given%20that%20you've%20said%20you%20have%20thousands%20of%20records%2C%20it%20just%20isn't%20clear%20what%20you%20really%20want.%20The%20formula%20is%20easy%20once%20you%20define%20things%20clearly.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20your%20question%3A%20%3CEM%3ENew%20data%20addition%20will%20always%20be%20in%20the%20last%20row%3B%20what%20is%20the%20possible%20option%20to%20get%20the%20date%20from%20the%20previous%20instance%20without%20sorting%20by%20SAN%20ID%3F%3C%2FEM%3E%20I%20need%20to%20ask%20again%2C%20%22previous%20instance%22%20of%20what%3F%3F%20Last%20instance%20for%20the%20given%20SAN%20ID%3F%20Say%20that.%20Last%20instance%20over%20all%3F%20Say%20that.%20Date%20and%20time%20of%20start%26nbsp%3B%20or%20end%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1554083%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1554083%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%3BHi%3B%20Yes%20I%20am%20referring%20to%20last%20instance%20for%20the%20given%20SAN%20ID...%3C%2FP%3E%3CP%3ESorting%20by%20SAN%20ID%20is%20the%20last%20resort%20if%20unable%20to%20get%20last%20instance%20for%20the%20given%20SAN%20ID%3B%20else%20need%20is%20sort%20by%20activity%20date...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1554237%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1554237%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F742188%22%20target%3D%22_blank%22%3E%40shahzad_afzal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESorry%2C%20but%20you%20seem%20to%20answer%20only%20one%20question%20at%20a%20time.%20There%20were%20others%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3EI%20need%20to%20ask%20what%20you%20thought%20of%20the%20version%20I%20created.%3C%2FLI%3E%3CLI%3EBut%20also%2C%20whether%20you%20use%20that%20or%20not%2C%20you%20really%20haven't%20ever%20clarified%20what%20the%20whole%20process%20is%20that%20you%20are%20trying%20to%20create.%20It's%20clear%20that%20you're%20capturing%20data%20on%20various%20events%2C%20but%20toward%20what%20purpose%3F%20Does%20a%20report%20sorted%20by%20SAN%20ID%20have%20a%20place%3F%20Would%20it%20be%20better%20to%20just%20extract%20the%20full%20history%20of%20any%20given%20SAN%20ID%3F%20Given%20that%20you've%20said%20you%20have%20thousands%20of%20records%2C%20it%20just%20isn't%20clear%20what%20you%20really%20want.%20The%20formula%20is%20easy%20once%20you%20define%20things%20clearly.%3C%2FLI%3E%3C%2FUL%3E%3CP%3EWould%20you%20please%20address%20both%20of%20these%20bullets%3F%20The%20first%20one%20is%20more%20curiosity--since%20I%20spent%20some%20time%20creating%20an%20alternative%20approach%2C%20I%20wondered%20if%20it%20had%20any%20value.%20The%20second%20is%20my%20attempt%20to%20get%20a%20much%20better%20understanding%20of%20the%20full%20context.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1555122%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1555122%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%3BHi%3B%20answering%20all%20of%20your%20pending%20questions%3A%3C%2FP%3E%3CP%3E1.%20your%20version%20is%20working%20perfectly%20fine%20on%20SAN%20base%20sort...%3C%2FP%3E%3CP%3E2.%20business%20is%20internet%20services%3B%20customer%20joining%2C%20using%2C%20lock%20if%20not%20at%20home%20for%20some%20time%20and%20terminate%20if%20not%20needed...%20Upgrade%20or%20downgrade%20is%20also%20available%20as%20required...%3C%2FP%3E%3CP%3E3.%20Extracting%20SAN%20base%20report%20is%20easy%3B%20but%20on%20daily%20base%2C%20if%20I%20extract%20and%20add%20in%20the%20sheet%3B%20it%20will%20again%20be%20date%20sorted...%20SAN%20sorting%20is%20still%20a%20last%20resort%20if%20date%20based%20sorting%20option%20is%20not%20workable...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1555581%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1555581%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F742188%22%20target%3D%22_blank%22%3E%40shahzad_afzal%3C%2FA%3E%26nbsp%3B%20I%20am%20still%20curious%20about%20the%203%20equations%20I%20presented%20in%20my%20attachment%20previously%20and%20if%20they%20work%20or%20what%20doesn't%20work.%26nbsp%3B%20Also%2C%20I%20pointed%20out%20that%20the%20first%20row%20had%20a%20start%20date%20after%20the%20end%20date%20and%20was%20wondering%20if%20that%20was%20just%20a%20typo%20in%20the%20sample%20or%20something%20that%20should%20be%20expected%20in%20this%20data%20set.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1555580%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1555580%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F742188%22%20target%3D%22_blank%22%3E%40shahzad_afzal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20do%20realize%2C%20I%20trust%2C%20that%20your%20first%20example%20(and%20all%20since)%20have%20been%20SAN-based%20sorts.%20So%20if%20that's%20not%20what%20you%20want%20(or%20only%20as%20a%20last%20resort)%2C%20then%20it%20remains%20confusing%20as%20to%20what%20you%20actually%20need%20here.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYour%20original%20request%20was%20for%20a%20formula%20to%20generate%20a%20date%2C%20the%20max%20date%20for%20previous%20transactions%20for%20the%20given%20SAN%20ID.%20Unless%20I'm%20mistaken%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%20has%20given%20you%20several%20workable%20solutions%20to%20that%20original%20question.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20just%20said%20in%20your%20last%20message%20that%20the%20revised%20spreadsheet%20I%20gave%2C%20separating%20the%20input%20from%20an%20output%2C%20was%2C%20in%20your%20words%20%3CEM%3Eworking%20perfectly%20fine%20on%20SAN%20base%20sort....%3C%2FEM%3E%20And%20I'll%20remind%20you%2C%20first%2C%20that%20a%20SAN%20base%20sort%20is%20what%20you%20originally%20presented%20as%20needing%20a%20solution.%20So%20if%20mine%20was%20working%20perfectly%2C%20what%20remains%20to%20be%20done%3F%20Second%2C%20that's%20an%20output%20report%2C%20so%20if%20in%20fact%20it's%20not%20perfect--if%20you%20want%20some%20other%20kind%20of%20sort%2C%20for%20example--then%20describe%20that.%20The%20WHOLE%20POINT%20was%20to%20separate%20the%20raw%20data%20from%20the%20output.%20The%20SORT%20function%20enables%20us%20to%20take%20the%20raw%20input%20data%20and%20sort%20it%20in%20a%20variety%20of%20ways%3B%20I%20chose%20SAN%20based%20because%20that's%20what%20you'd%20given%20us%20as%20needing%20to%20be%20fixed.%20If%20that's%20not%20in%20fact%20what%20you%20want%2C%20then%20tweak%20it%3B%20sort%20it%20a%20different%20way.%20Don't%20tell%20me%20it's%20%22working%20perfectly%22%20and%20then%20ignore%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CU%3EMy%20point%20so%20far%3A%3C%2FU%3E%20from%20all%20appearances%2C%20it%20looks%20like%20you've%20gotten%20workable%20answers%20to%20the%20dilemma%20you%20first%20presented.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENow%2C%20however%2C%20let%20me%20go%20back%20to%20one%20of%20your%20earlier%20messages.%20I%20noticed%20something%20there%20that%20may%20help%20resolve%20the%20confusion%20in%20the%20room.%20You%20said%20a%20few%20days%20ago%20something%20that%20we%20may%20have%20missed%20at%20the%20time%3A%3C%2FP%3E%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CU%3E%3CEM%3E%3CSTRONG%3EI%20would%20love%20to%20sort%20this%20by%20activity%20date%20as%20every%20month%20need%20to%20generate%20a%20month%20activity%20report%20and%20revenue%20report%20out%20of%20it...%3C%2FSTRONG%3E%20%3C%2FEM%3E%3C%2FU%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20maybe%20the%20crux%20of%20the%20matter%20here--and%20what%20would%20actually%20answer%20the%20questions%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%20and%20I%20have%20been%20asking%2C%20would%20resolve%20the%20confusion%20we've%20expressed--centers%20on%20this%20monthly%20activity%20report.%20Maybe%20what%20you've%20been%20showing%20us%20isn't%20really%20what%20you%20need%20at%20all%3B%20it's%20just%20closing%20the%20loop%20on%20an%20individual%20transaction.%20What%20you%20really%20are%20needing%20to%20produce%20is%20this%20monthly%20activity%20report.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20let%20me%20ask%20this%3A%20what%20does%20that%20required%20monthly%20Activity%20Report%20need%20to%20show%3F%20I%20would%20assume--but%20want%20your%20confirmation%20and%20clarification--that%20a%20monthly%20activity%20report%20would%20consists%20of%20such%20things%20as%3A%3C%2FP%3E%3CUL%3E%3CLI%3ECount%20of%20active%20customers%20at%20end%20of%20prior%20month%3C%2FLI%3E%3CLI%3ECount%20of%20new%20additions%20during%20the%20month%3C%2FLI%3E%3CLI%3ECount%20of%20terminations%20during%20the%20month%3C%2FLI%3E%3CLI%3ECounts%20of%20upgrades%2Fdowngrades%3C%2FLI%3E%3CLI%3EOther%3F%3C%2FLI%3E%3CLI%3ECurrent%20Active%20customers%20at%20end%20of%20current%20month%3C%2FLI%3E%3C%2FUL%3E%3CP%3EPlease%20clarify%20or%20correct.%20If%20you%20have%20an%20example%20of%20that%20monthly%20activity%20report%2C%20could%20you%20post%20it%3F%20How%20is%20it%20generated%3F%20What%20relationship%20does%20the%20spreadsheet%20you've%20been%20sharing%20with%20us%20have%20with%20that%20monthly%20activity%20report%3F%3C%2FP%3E%3CP%3EDo%20you%20also%20do%20something%20like%20that%20on%20a%20daily%20basis%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENow%3A%20you%20don't%20need%20to%20answer%20any%20of%20those%20questions.%20If%20the%20monthly%20process%20is%20working%20just%20fine%2C%20I'll%20be%20glad%20to%20hear%20it.%20If%20all%20you%20needed%20was%20the%20formula%20you%20originally%20asked%20about%2C%20then%20let's%20go%20back%20to%20my%20earlier%20points%20here%2C%20that%20it%20appears%20from%20the%20record%20that%20you've%20gotten%20workable%20answers....what%20in%20what%20you've%20received%20from%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%20or%20me%20needs%20further%20revision%2C%20or%20have%20you%20in%20fact%20received%20a%20workable%20answer%3F%20If%20not%2C%20you're%20going%20to%20need%20to%20be%20a%20lot%20clearer%20on%20exactly%20what%20you%20need.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1556111%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1556111%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%3Byou%20are%20right%20about%20reports...%3C%2FP%3E%3CUL%3E%3CLI%3ECount%20of%20active%20customers%20at%20end%20of%20prior%20month%3C%2FLI%3E%3CLI%3ECount%20of%20new%20additions%20during%20the%20month%3C%2FLI%3E%3CLI%3ECount%20of%20terminations%20during%20the%20month%3C%2FLI%3E%3CLI%3ECounts%20of%20upgrades%2Fdowngrades%3C%2FLI%3E%3CLI%3EOther%3F%3C%2FLI%3E%3CLI%3ECurrent%20Active%20customers%20at%20end%20of%20current%20month%3C%2FLI%3E%3C%2FUL%3E%3CP%3EIf%20by%20any%20mean%3B%20new%20activity%20will%20get%20date%20from%20last%20instance%20(activity%20end)%20date%2C%20everything%20will%20work%20as%20I%20need...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1556124%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1556124%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3BAttaching%20updated%20sheet...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1556209%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1556209%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F742188%22%20target%3D%22_blank%22%3E%40shahzad_afzal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3EIf%20by%20any%20mean%3B%20new%20activity%20will%20get%20date%20from%20last%20instance%20(activity%20end)%20date%2C%20everything%20will%20work%20as%20I%20need...%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20that's%20your%20last%20word%20on%20this%2C%20then%20I%20believe%20you've%20gotten%20more%20than%20one%20way%20to%20do%20that.%20%3CEM%3Efini%3C%2FEM%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1556397%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1556397%22%20slang%3D%22en-US%22%3EYes%3B%20final%20words%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1558864%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1558864%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%3BAny%20luck%20on%20the%20formula%20please....%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1559422%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1559422%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F742188%22%20target%3D%22_blank%22%3E%40shahzad_afzal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20don't%20seem%20to%20realize%20that%20what%20I've%20said%20is%20that%20until%20you%20give%20us%20feedback%20on%20the%20approaches%20we've%20given%20you%2C%20which%20appear%20to%20BE%20answers%2C%20functional%2C%20that%20we're%20done.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGo%20back%20and%20re-read%2C%20carefully%2C%20the%20most%20recent%20messages%20you've%20gotten.%20For%20example%2C%20you%20said%20that%20my%20different%20approach%20was%20working%20perfectly%2C%20from%20a%20SAN-ID%20sort%20basis.%20And%20I%20pointed%20out%20that%20the%20SAN%20ID%20sort%20is%20what%20you've%20been%20giving%20us%20all%20along.%20So%20if%20it's%20working%20%22perfectly%2C%22%20don't%20ignore%20it.%20Suggest%20a%20different%20way%20to%20sort%20it.%20You%20can%20in%20fact%20tweak%20the%20formula%20yourself%20to%20change%20the%20basis%20for%20the%20sort%3B%20it's%20all%20accomplished%20by%20the%20SORT%20function.%20The%20whole%20point%20there%20was%20that%20when%20you%20separate%20the%20output%20from%20the%20input%2C%20you%20can%20tweak%20the%20output%20until%20it%20is%20what%20you%20need.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFrom%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%20you%20got%20several%20formulas%20and%20he%20was%20left%20without%20any%20answer%20from%20you%20as%20to%20whether%20they%20worked...and%20they%20do%20appear%20to.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%2C%20as%20I%20said%20in%20my%20previous%20last%20post%2C%20it%20appears%20you%20have%20gotten%20satisfactory%20answers.%20If%20they're%20not%2C%20then%20you%20need%20to%20do%20a%20LOT%20more%20to%20be%20clear%20on%20what%20is%20needed%2C%20why%20what%20you've%20been%20given%20doesn't%20work.%20It%20appears%20otherwise%20that%20you're%20just%20ignoring%20what%20you've%20been%20given%20already.%20So%20it's%20not%20that%20we%20don't%20want%20to%20help%3B%20it's%20that%20%3CU%3Eyou%20don't%20appear%20to%20be%20able%20to%20respond%20in%20any%20%3CSTRONG%3Esubstantive%3C%2FSTRONG%3E%20way%20to%20what%20you%20HAVE%20been%20given.%3C%2FU%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1559857%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20Formula%20Help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1559857%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%3BThanks%20for%20your%20time%20and%20help...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi; I am using a lookup formula to get the last date of any reference number and then add one sec to it...
=IF(D10="New Addition",E10,LOOKUP(3,(1/($C$4:$C$54=C10)+(1/$G$4:$G$54<>"")),$G$4:$G$54)+1/86400)
Its is doing good... What I need is to restrict this function to cells in column before cell formula is running... Example: formula has to look at C10 and get max date; it will only use data from C4:C9... Data below it, don't want to use...

30 Replies

@shahzad_afzal 

 

You clearly know about absolute and relative cell references, which would be part of the answer. But what do you do if you're in Cell C345? Is there always only a difference of 5 rows between the start and finish row for that formula you're asking about.

 

In other words, what we need from you is a bit more information on the larger context here...how is the table being built?

 

By the way, another  (and I think clearer) way to add a second to the value of another date&time cell is to use +TIME(0,0,1)

 

@mathetes I am attaching a test case for you to review...

When you sort data with the date which I have to, every thing will get disturbed...

I just want the highest date till the selected row and not after that to be used to get dates; else every time; highest date is displayed from the column...

@shahzad_afzal 

 

I am not following you at all...that is, I don't understand what you're trying to do with the sample spreadsheet; your words in this last post don't fully make sense either.

 

When you sort data with the date which I have to, every thing will get disturbed...

  • Sort?
  • Sort data with the date which I have to? ("have to" meaning "must do"?)
  • everything will get disturbed? (supposed to get disturbed; will in the course of "sorting")

 

I just want the highest date till the selected row and not after that to be used to get dates; else every time; highest date is displayed from the column...

  • Which column(s) are you referring to? There are five columns in your example; three of them are dates AND times.
  • What is supposed to happen with column E? How do column D and F affect that.
    • Please answer that question in words....I know that's what your formula is trying to do, and it's what your question is about. But spell it out more completely.

@mathetes sorry for the confusions...

Column E will have two type of dates; one if new addition and date will come from Column D... When activity ends; next time will have one second addition... Column E will get date & time from Column D for all activities other than new addition...

Now come to Column B & Row 10; ABC2000078304... If i will copy paste formula; i will get highest date from column F which is F17 Cell... I want it to get date with reference to cell F10 only...

 

Hope this makes sense...

@shahzad_afzal 

 

Sorry. Still not making sense.

 

Walk me though what's happening in each column in rows 9 through 19.

  • The two entries "New Addition" and "Termination" make sense.
  • What does "Locked" mean? what does "Active" mean?
  • And how does each event affect the various time stamps?

@mathetes A customer joined on new addition... After some time; customer wants to lock his internet link or terminate when not needed... Scenario 1; customer ID ABC2000078304 (Cell B9); came on network... Stayed active from 12th Mar till 16th Mar and went to lock...

The moment i run lookup; E10 will get date from F17 which is the highest date in the column... It has to be 16th Mar not 25th Mar...

Just copy paste formula from E5 onwards till E28, you will see that column E will get populated with highest date record from column F...

I want ABC2000078304 related record, whatever row number it is; will get date from the previous record only, rather than max date from column F... 

@shahzad_afzal 

 

I know it's clear in your mind. It's not in mine. A big part of the confusion in my mind is (I think) caused by Column E apparently being the final or more important part of the record, yet appearing between D and F...so it's that relationship and your reference to rows that appear to FOLLOW rather than precede (like why does E10 get a date from F17?)...

 

Let me ask again, and I'll not confuse it by asking subordinate questions:

 

Row by row, what's happening? Walk me though what's happening in each column, especially E, in each of the rows, 9 through 19.

@mathetes Row 9; a new addition of customer number ABC2000078304... Manual entry of Date in Column D... In column E, it will get date from D as its a new addition...

After 4 days; customer decided to lock it link temporary for any reason; a manual entry in column F...

As the status changed to Locked; added a new row to show customer went to lock and will stay in lock till the time a manual entry of activity end is added in column F against it...

After less than 1 hour; customer decided to be active again... Added a manual entry and activity of lock ended and customer moved to active state in row 11... same type of lock and active state will go on till the time customer decided in row 18 to terminate the link on 25th Mar... Active status ends with a manual entry in F17 and shows being terminated in E18...

1 Sec is a system delay to process the request...

 

If I run the lookup formula; like I shared in my first message; excel will get 25th mar date in E10 as the maximum date of any customer whereas I need the date of last instance in E10 which is 16th Mar 5:59:56...

 

Hope this is clear now...

@shahzad_afzal 

 

You wrote: Hope this is clear now...

 

But it's not quite.

 

In particular. when you say If I run the lookup formula ... excel will get 25th mar date in E10 as the maximum date of any customer whereas I need the date of last instance in E10 which is 16th Mar 5:59:56...

 

But as I look at your sheet, the value in E10 is March 16, 2020 5:59:57; the value you cite as what you need is in D9 (the cell that feeds E10)     So which is it that you need? And, more importantly for writing the formula, why is it that cell? What distinguishes it? You say it's "the last instance", but "last instance of what"? precisely.

 

Let me re-raise a question I asked you early yesterday:  if I go back to your second message yesterday you said something that I questioned at the time. I need to ask again. You wrote: 

When you sort data with the date which I have to, every thing will get disturbed...

I just want the highest date till the selected row and not after that to be used to get dates; else every time; highest date is displayed from the column...

It is now striking me that maybe a big part of the confusion here, in what you're saying AND in the procedure itself that you're following, is that you routinely sort this table, from appearances the San ID column (column B) is the primary sort, and Activity Start is the secondary sort. Is that the case? Do you enter new event data at the bottom of the table and then sort? That could indeed have the effect you describe: "everything will get disturbed."

 

If that's the case, the solution would be, first, to separate the  procedure by which you collect the event data from the procedure by which you display it. Said another way, to distinguish between input and output.

 

The reason: if you are indeed sorting this table routinely, that will disturb the relationships between rows, as things get rearranged.

 

So first please clarify that aspect of how you add rows (new customers, new events) to this table in the first place. And answer the question of whether or not it gets sorted so as to distinguish between customers.

@shahzad_afzal     I think I understand what is trying to be done here.  I agree with  @mathetes that it might be a good practice to set up the sheet as a database input sheet and then use pivot table to display the data in the desired format.  But to @shahzad_afzal  question I believe you are looking for the formula in the original post to be corrected to work and that would be to use partial absolute and relative references similar to what is being used in the sample sheet you provided.  

so in the sample sheet row 10 you have:

=IFERROR(IF(C10="New Addition",D10,LOOKUP(B10,$B$4:B9,$F$4:F9)+1/86400),"")

notice how it has absolute reference for $B$4 but relative reference for B9

I believe you want to switch to a formula that looks like the one you posted so you need to have a similar mix of absolute and relative references (modified to work on row 10 of sample sheet)

=IF(C10="New Addition",D10,LOOKUP(3,(1/(B$4:B9=B10)+(1/F$4:F9<>"")),F$4:F9)+1/86400)

that said you might also consider another variation that I find easier to read:

=IF(C10="New Addition",D10,MAXIFS($F$3:$F9,$B$3:$B9,$B10)+TIME(,,1))

 

I am also not clear about what your problem actually is since the formula you already have on the sheet appears to be working but hopefully these variations might help.  If not please explain this problem with sorting and it getting mixed up.

 

EDIT:  I just had a thought if you are moving things around and such and having issues with finding the "correct" max previous end time then just add the whole table to the MAXIFS and add another condition that the END TIME must be less than the END TIME from this row but had to add another IF condition for the "Termination" to just use the max time because there is no END TIME in that row:

=IFS(C4="New Addition",D4,C4="Termination",MAXIFS(F:F,B:B,B4)+TIME(,,1),TRUE,MAXIFS(F:F,B:B,B4,F:F,"<"&F4)+TIME(,,1))

@mtarler Dear Team; Thanks for jumping in to help me out... I am attaching version 2, with absolute values for the whole data...

Let me make it more open...

Is this possible to get date from last activity of relative SAN??? Whatever is the last activity...

Forget about lookup and any formula I already shared... I don't want to get max date from the column against relative SAN ID... I just want next activity to find previous activity, get its date & time and add 1 sec to it and done...

There will be 1000s of SANs with multiple activities daily... You can suggest sorting type too, either SAN based or activity date...

 

 

Regards

@shahzad_afzal 

 

You still haven't answered the question about whether or not it is your practice to sort this table routinely. That's an important question. Neither @mtarler nor I was suggesting that you should do so; we're asking IF you do.

 

And it appears that you do, just from the evidence that SANID ABC2000078423 begins activity (is a New Addition) with a date that precedes the termination date of ABC2000078304. So you're either sorting OR you are adding rows by insertion. Either way, you're not handling this as a neat and simple Excel Table for input.

 

The kind of formula you are looking for is an easy matter.

 

But it's important to know how this table is being maintained from the point of view of data entry. And then it might well make a lot of sense to treat it solely as a data entry table (Input), and create a separate tab that extracts the data and sorts it to form a  useful report (Output).

 

I'm going to create a mockup of what I'm describing for you and will post it shortly.

@mathetes Hi; Data entry will be manual like adding new addition date; then adding activity end date, which will help to get next activity start date and so on till termination... I would love to sort this by activity date as every month need to generate a month activity report and revenue report out of it... I can add another sheet and can use VLOOKUP to get new addition date into the formula... Rest all data will be here...

 

@shahzad_afzal 

 

You wrote: Data entry will be manual like adding new addition date; then adding activity end date, which will help to get next activity start date and so on till termination...

 

Which doesn't yet make it clear. Of course you add new data by entering an ID, an activity description, and a date. The question was aimed at how the table is maintained, which wasn't so much what data are entered--that's pretty obvious--but whether or not you enter each transaction at the bottom of the table, regardless of which SAN ID it is, or do you insert a row in the section for the given SAN ID? 

 

Let me take a few minutes to create a mock-up for how transactional databases are generally laid out, with an example of what could then be created as an output report.

 

 

@shahzad_afzal  I looked at your new sample sheet and the 1st table with Absolute and Relative reference seems to do what you want.  Is there a problem with that?  I still don't know what was not working with the original lookup (using abs and relative references) in the original sample sheet.  I have attached a sheet with multiple variations for the START TIME using each of the formulas.  all of them except the fully absolute reference seem to work.  Let me know what isn't working if needed, but I think the last one I gave is the most 'robust' solution.  I attached the file and included an conditional formatting that highlights any START TIME that is > END TIME to highlight problems.  That highlighted the first row because the New Addition Date is actually after the END TIME.

@shahzad_afzal 

 

Here's a totally different approach. It uses most of your data but approaches it by separating INPUT from OUTPUT.

 

The input table uses most of your raw data, but simplified to only three columns and they've been entered in date and time sequence:

  • Start date and time
  • SAN ID
  • Transaction (event)

 

Then I use two formulas only to create the output.

  • The first one is =SORT(Table1,2) which sorts the input table on the basis of the second column, which is SAN ID   It "spills" down to populate however many rows there are in the basic input table. That could be refined if need be, to limit it in various ways, depending on your needs. SORT is one of the new Dynamic Array functions, available only in the newest release of Excel. If this doesn't work for you, that's why.
  • The second formula is =IF(C5=C4,B5-TIME(0,0,1),"") and that actually derives the end time from the start time of the NEXT activity for the same SAN ID. In other words, I've reversed your logic. AND I only create the end time at the report stage of things. It's assumed that when you start a new stage of the contract with a given SAN ID, that it means the last stage is now superceded.

 

I would encourage you to add additional events, new SANIDs, at the bottom of the input sheet. You'll see that the output sheet will automatically keep up with it.

 

 

 

 

@mathetes Dear; added more data (see attached) and if sorted by SAN ID, things are perfect...

New data addition will always be in the last row; what is the possible option to get the date from the previous instance without sorting by SAN ID?

@shahzad_afzal 

 

I need to ask what you thought of the version I created.

 

But also, whether you use that or not, you really haven't ever clarified what the whole process is that you are trying to create. It's clear that you're capturing data on various events, but toward what purpose? Does a report sorted by SAN ID have a place? Would it be better to just extract the full history of any given SAN ID? Given that you've said you have thousands of records, it just isn't clear what you really want. The formula is easy once you define things clearly.

 

To your question: New data addition will always be in the last row; what is the possible option to get the date from the previous instance without sorting by SAN ID? I need to ask again, "previous instance" of what?? Last instance for the given SAN ID? Say that. Last instance over all? Say that. Date and time of start  or end?

@mathetes Hi; Yes I am referring to last instance for the given SAN ID...

Sorting by SAN ID is the last resort if unable to get last instance for the given SAN ID; else need is sort by activity date...