Massive Data Analysis needing a helper column

Noxqss38242

Board Regular
Joined
Sep 15, 2017
Messages
225
Office Version
  1. 2016
2021 YTD Data.Master.Copy.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQAR
4504TRAC16869409,813409,49916700--1689903/25/214127 Mar 21TermININDIANAPOLISPMPM00PWRUNT00TRAC001UNITAPM-ANN99NA01DUE3.40187.00244.10$431.103,401,508B0016869012018INTL10/10/17C1LTPM ANN
4505TRAC16869409,813409,49916700--1689903/26/214227 Mar 21TermININDIANAPOLISMAMAINT14FRAME075THWHL001ASMBLY01ADJ99NA21OUTADJ0.105.500.00$5.503,401,508B0016869012018INTL10/10/17C1LTADJUST FIFTH WHEEL
4506TRAC16869409,813409,49916700--1689903/25/214127 Mar 21TermININDIANAPOLISMAMAINT32CRNKSY01BA/CAB001BATT26RECHRG04QTY 443WEAK0.2011.000.00$11.003,401,508B0016869012018INTL10/10/17C1LTJUMP START AND PUT ON CHARGER
4507TRAC16869409,813409,49916700--1689903/25/214127 Mar 21TermININDIANAPOLISMAMAINT32CRNKSY01BA/CAB001BATT03RPLNEW04QTY 443WEAK1.4077.000.04$77.043,401,508B0016869012018INTL10/10/17C1LTTEST AND REPLACE 4 BATTERIES
4508TRAC16869409,813409,49916700--1689903/25/214127 Mar 21TermININDIANAPOLISACACCID04AERODY05SKIRTS001FRONT24REPAIR22LEFT12BROKEN2.20121.00137.88$258.883,401,508B0016869012018INTL10/10/17C1LTREPAIR STEP BRACKETS FOR BATTERY COVER
4509TRAC16869409,813409,49916700--1689903/26/214227 Mar 21TermININDIANAPOLISDEDRVERR15STEERG01WHEEL001ST WHL24REPAIR99NA12BROKEN0.105.5089.16$94.663,401,508B0016869012018INTL10/10/17C1LTR R CITY HORN PAD
4510TRAC16869409,813409,49916700--1689903/26/214227 Mar 21TermININDIANAPOLISMAMAINT52ELACCS05CB003CBWIRE19WIRE99NA46MISSNG0.2011.006.59$17.593,401,508B0016869012018INTL10/10/17C1LTR R CB POWER CABLE
4511TRAC16869409,813409,49916700--1689903/26/214227 Mar 21TermININDIANAPOLISMAMAINT43EXHSYS05DPF001FILTER55REGEN99NA01DUE1.8099.000.00$99.003,401,508B0016869012018INTL10/10/17C1LTREGEN
4512TRAC16869409,813409,49916700--1689903/26/214227 Mar 21TermININDIANAPOLISMAMAINT01HVAC02AC CAB261CONTRL09DIANOS99NA00NOFAIL0.3016.500.00$16.503,401,508B0016869012018INTL10/10/17C1LTCHECK MAX AC INOP BLOWS WEAK NOT VERY COLD
4513TRAC16869413,450414,05616700--1689904/18/214228 Apr 21TermWMWEST MEMPHISPMPM00PWRUNT00TRAC001UNITBB INSP99NA01DUE0.000.000.00$0.003,415,815S0016869012018INTL10/10/17C1LTCSA
4514TRAC168690415,16516700--1689904/28/214328 Apr 21VendROROAD REPAIRRHRD HAZ96TIRES03DRIVE001RPL 104RETRED0.000.000.00$180.003,412,107R1180432012018INTL10/10/17C1LTRRI
4515TRAC168690415,16516700--1689904/28/214328 Apr 21VendROROAD REPAIRRHRD HAZ96TIRES03DRIVE999OTHER71SCRAP01QTY 112BROKEN0.000.000.00$10.003,412,107R1180432012018INTL10/10/17C1LTSCRAP
4516TRAC168690415,16516700--1689904/28/214328 Apr 21VendROROAD REPAIRRHRD HAZ14FRAME09MUDFLP003BRACKT03RPLNEW23RIGHT12BROKEN0.000.000.00$100.503,412,107R1180432012018INTL10/10/17C1LTR M F BRKT
4517TRAC168690415,16516700--1689904/28/214328 Apr 21VendROROAD REPAIRRHRD HAZ14FRAME09MUDFLP001MUDFLP03RPLNEW23RIGHT49CUT0.000.000.00$37.493,412,107R1180432012018INTL10/10/17C1LTR M F
4518TRAC16870353,493353,49316700--1689901/07/213925 Jan 21VendROROAD REPAIRMAMAINT00PWRUNT00TRAC001UNIT64MOTEL99NA88RECALL0.000.000.00$161.503,391,449R1207900012018INTL10/10/17C1LTCOMPLAINT: MOTEL ROOM NIGHT 1 2
4519TRAC16870353,522353,49316700--1689901/06/213925 Jan 21TermWMWEST MEMPHISPMPM00PWRUNT00TRAC001UNITBB INSP99NA01DUE0.000.000.00$0.003,387,948B1168492012018INTL10/10/17C1LTCSA
4520TRAC16870353,522353,49316700--1689901/06/213925 Jan 21TermWMWEST MEMPHISPMPM00PWRUNT00TRAC001UNITAPM-ANN99NA01DUE3.60198.00213.45$411.45PTL WMPTL - West Memphis3,387,948B1168492012018INTL10/10/17C1LTPM ANN
4521TRAC16870353,522353,49316700--1689901/07/213925 Jan 21TermWMWEST MEMPHISMAMAINT13BRKTRA02DRVAXL019BRKCHA03RPLNEW10R REAR12BROKEN3.00165.0062.48$227.483,387,948B1168492012018INTL10/10/17C1LTRR BRAKE CHAMBER BROKEN
4522TRAC16870353,522353,49316700--1689901/06/213925 Jan 21TermWMWEST MEMPHISMAMAINT45ENGINE10O DIST002FILCAP03RPLNEW99NA44WORN0.2011.0052.83$63.833,387,948B1168492012018INTL10/10/17C1LTREPLACE OIL CAP
4523TRAC16870353,522353,49316700--1689901/07/213925 Jan 21TermWMWEST MEMPHISMAMAINT13BRKTRA07LINES010SPRING01ADJ99NA21OUTADJ0.3016.500.00$16.503,387,948B1168492012018INTL10/10/17C1LTAIRLINE NEED ADJ
4524TRAC16870353,522353,49316700--1689901/07/213925 Jan 21TermWMWEST MEMPHISMAMAINT04AERODY05SKIRTS003REAR24REPAIR22LEFT19LOOSE0.6033.000.00$33.003,387,948B1168492012018INTL10/10/17C1LTSIDESKIRT LOOSE
4525TRAC168700353,49316700--1689901/09/213925 Jan 21VendWMWEST MEMPHISMAMAINT32CRNKSY01BA/CAB010LVD24REPAIR99NA88RECALL0.000.000.00$0.00NAVMEMNAVISTAR/MIDAMERICA INTL3,316,685M0016870012018INTL10/10/17C1LTVMRS CODE: MA 32 01 010 24 99 88
4526TRAC16870357,508357,50816700--1689901/30/214025 Jan 21VendROROAD REPAIRRHRD HAZ96TIRES03DRIVE001RPL 103RPLNEW0.000.000.00$513.043,395,943R1175006012018INTL10/10/17C1LTCOMPLAINT:RRO DRV TIRE BLOWN
4527TRAC16870357,508357,50816700--1689901/30/214025 Jan 21VendROROAD REPAIRRHRD HAZ96TIRES03DRIVE999OTHER71SCRAP01QTY 112BROKEN0.000.000.00$0.003,395,943R1175006012018INTL10/10/17C1LTDISPOSAL
4528TRAC16870356,218356,21816700--1689901/15/213925 Jan 21TermWMWEST MEMPHISPMPM00PWRUNT00TRAC001UNITBB INSP99NA01DUE0.000.000.00$0.003,376,516S0016870012018INTL10/10/17C1LTCSA
4529TRAC16870357,508358,60416700--1689902/03/214026 Feb 21VendROROAD REPAIRRHRD HAZ96TIRES03DRIVE999OTHER72RD SVC0.000.000.00$558.283,395,943R1175006012018INTL10/10/17C1LTSERVICE CALL
4530TRAC16870363,437363,43716700--1689902/28/214126 Feb 21TermWMWEST MEMPHISPMPM00PWRUNT00TRAC001UNITBB INSP99NA01DUE0.000.000.00$0.003,401,911S0016870012018INTL10/10/17C1LTCSA
YTD Data
Cell Formulas
RangeFormula
G4518:G4528,G4504:G4512G4504=(F4504-AL4504)/(365/12)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
T:TCell Value="A"textNO



Needing help on this one. I want the far right column to count days since "work code" A was used.
So in this, column AR should say "0" for the days A was used (date located on the 6th column, in this case the date is 3/25/21)
Where it is difficult is that not all units at this point have an "A" work code entered so it also has to take into account the unit number is different and thus shouldn't count but rather be blank.
So where column T has "A" and column B = the same unit number, count days elapsed since the date located on column F
If column B doesn't equal the unit number associated with work code "A" and no "A" work code is present, then return blank.

Any help on this will be a game changer for me. Or if you know of another way to track how many days elapsed for each line since work code "A" was entered taking into account the unit number (column B)


Thank you in advance!!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
2021 YTD Data.Master.Copy.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQAR
4504TRAC16869409,813409,49916700--1689903/25/214127 Mar 21TermININDIANAPOLISPMPM00PWRUNT00TRAC001UNITAPM-ANN99NA01DUE3.40187.00244.10$431.103,401,508B0016869012018INTL10/10/17C1LTPM ANN
4505TRAC16869409,813409,49916700--1689903/26/214227 Mar 21TermININDIANAPOLISMAMAINT14FRAME075THWHL001ASMBLY01ADJ99NA21OUTADJ0.105.500.00$5.503,401,508B0016869012018INTL10/10/17C1LTADJUST FIFTH WHEEL
4506TRAC16869409,813409,49916700--1689903/25/214127 Mar 21TermININDIANAPOLISMAMAINT32CRNKSY01BA/CAB001BATT26RECHRG04QTY 443WEAK0.2011.000.00$11.003,401,508B0016869012018INTL10/10/17C1LTJUMP START AND PUT ON CHARGER
4507TRAC16869409,813409,49916700--1689903/25/214127 Mar 21TermININDIANAPOLISMAMAINT32CRNKSY01BA/CAB001BATT03RPLNEW04QTY 443WEAK1.4077.000.04$77.043,401,508B0016869012018INTL10/10/17C1LTTEST AND REPLACE 4 BATTERIES
4508TRAC16869409,813409,49916700--1689903/25/214127 Mar 21TermININDIANAPOLISACACCID04AERODY05SKIRTS001FRONT24REPAIR22LEFT12BROKEN2.20121.00137.88$258.883,401,508B0016869012018INTL10/10/17C1LTREPAIR STEP BRACKETS FOR BATTERY COVER
4509TRAC16869409,813409,49916700--1689903/26/214227 Mar 21TermININDIANAPOLISDEDRVERR15STEERG01WHEEL001ST WHL24REPAIR99NA12BROKEN0.105.5089.16$94.663,401,508B0016869012018INTL10/10/17C1LTR R CITY HORN PAD
4510TRAC16869409,813409,49916700--1689903/26/214227 Mar 21TermININDIANAPOLISMAMAINT52ELACCS05CB003CBWIRE19WIRE99NA46MISSNG0.2011.006.59$17.593,401,508B0016869012018INTL10/10/17C1LTR R CB POWER CABLE
4511TRAC16869409,813409,49916700--1689903/26/214227 Mar 21TermININDIANAPOLISMAMAINT43EXHSYS05DPF001FILTER55REGEN99NA01DUE1.8099.000.00$99.003,401,508B0016869012018INTL10/10/17C1LTREGEN
4512TRAC16869409,813409,49916700--1689903/26/214227 Mar 21TermININDIANAPOLISMAMAINT01HVAC02AC CAB261CONTRL09DIANOS99NA00NOFAIL0.3016.500.00$16.503,401,508B0016869012018INTL10/10/17C1LTCHECK MAX AC INOP BLOWS WEAK NOT VERY COLD
4513TRAC16869413,450414,05616700--1689904/18/214228 Apr 21TermWMWEST MEMPHISPMPM00PWRUNT00TRAC001UNITBB INSP99NA01DUE0.000.000.00$0.003,415,815S0016869012018INTL10/10/17C1LTCSA
4514TRAC168690415,16516700--1689904/28/214328 Apr 21VendROROAD REPAIRRHRD HAZ96TIRES03DRIVE001RPL 104RETRED0.000.000.00$180.003,412,107R1180432012018INTL10/10/17C1LTRRI
4515TRAC168690415,16516700--1689904/28/214328 Apr 21VendROROAD REPAIRRHRD HAZ96TIRES03DRIVE999OTHER71SCRAP01QTY 112BROKEN0.000.000.00$10.003,412,107R1180432012018INTL10/10/17C1LTSCRAP
4516TRAC168690415,16516700--1689904/28/214328 Apr 21VendROROAD REPAIRRHRD HAZ14FRAME09MUDFLP003BRACKT03RPLNEW23RIGHT12BROKEN0.000.000.00$100.503,412,107R1180432012018INTL10/10/17C1LTR M F BRKT
4517TRAC168690415,16516700--1689904/28/214328 Apr 21VendROROAD REPAIRRHRD HAZ14FRAME09MUDFLP001MUDFLP03RPLNEW23RIGHT49CUT0.000.000.00$37.493,412,107R1180432012018INTL10/10/17C1LTR M F
4518TRAC16870353,493353,49316700--1689901/07/213925 Jan 21VendROROAD REPAIRMAMAINT00PWRUNT00TRAC001UNIT64MOTEL99NA88RECALL0.000.000.00$161.503,391,449R1207900012018INTL10/10/17C1LTCOMPLAINT: MOTEL ROOM NIGHT 1 2
4519TRAC16870353,522353,49316700--1689901/06/213925 Jan 21TermWMWEST MEMPHISPMPM00PWRUNT00TRAC001UNITBB INSP99NA01DUE0.000.000.00$0.003,387,948B1168492012018INTL10/10/17C1LTCSA
4520TRAC16870353,522353,49316700--1689901/06/213925 Jan 21TermWMWEST MEMPHISPMPM00PWRUNT00TRAC001UNITAPM-ANN99NA01DUE3.60198.00213.45$411.45PTL WMPTL - West Memphis3,387,948B1168492012018INTL10/10/17C1LTPM ANN
4521TRAC16870353,522353,49316700--1689901/07/213925 Jan 21TermWMWEST MEMPHISMAMAINT13BRKTRA02DRVAXL019BRKCHA03RPLNEW10R REAR12BROKEN3.00165.0062.48$227.483,387,948B1168492012018INTL10/10/17C1LTRR BRAKE CHAMBER BROKEN
4522TRAC16870353,522353,49316700--1689901/06/213925 Jan 21TermWMWEST MEMPHISMAMAINT45ENGINE10O DIST002FILCAP03RPLNEW99NA44WORN0.2011.0052.83$63.833,387,948B1168492012018INTL10/10/17C1LTREPLACE OIL CAP
4523TRAC16870353,522353,49316700--1689901/07/213925 Jan 21TermWMWEST MEMPHISMAMAINT13BRKTRA07LINES010SPRING01ADJ99NA21OUTADJ0.3016.500.00$16.503,387,948B1168492012018INTL10/10/17C1LTAIRLINE NEED ADJ
4524TRAC16870353,522353,49316700--1689901/07/213925 Jan 21TermWMWEST MEMPHISMAMAINT04AERODY05SKIRTS003REAR24REPAIR22LEFT19LOOSE0.6033.000.00$33.003,387,948B1168492012018INTL10/10/17C1LTSIDESKIRT LOOSE
4525TRAC168700353,49316700--1689901/09/213925 Jan 21VendWMWEST MEMPHISMAMAINT32CRNKSY01BA/CAB010LVD24REPAIR99NA88RECALL0.000.000.00$0.00NAVMEMNAVISTAR/MIDAMERICA INTL3,316,685M0016870012018INTL10/10/17C1LTVMRS CODE: MA 32 01 010 24 99 88
4526TRAC16870357,508357,50816700--1689901/30/214025 Jan 21VendROROAD REPAIRRHRD HAZ96TIRES03DRIVE001RPL 103RPLNEW0.000.000.00$513.043,395,943R1175006012018INTL10/10/17C1LTCOMPLAINT:RRO DRV TIRE BLOWN
4527TRAC16870357,508357,50816700--1689901/30/214025 Jan 21VendROROAD REPAIRRHRD HAZ96TIRES03DRIVE999OTHER71SCRAP01QTY 112BROKEN0.000.000.00$0.003,395,943R1175006012018INTL10/10/17C1LTDISPOSAL
4528TRAC16870356,218356,21816700--1689901/15/213925 Jan 21TermWMWEST MEMPHISPMPM00PWRUNT00TRAC001UNITBB INSP99NA01DUE0.000.000.00$0.003,376,516S0016870012018INTL10/10/17C1LTCSA
4529TRAC16870357,508358,60416700--1689902/03/214026 Feb 21VendROROAD REPAIRRHRD HAZ96TIRES03DRIVE999OTHER72RD SVC0.000.000.00$558.283,395,943R1175006012018INTL10/10/17C1LTSERVICE CALL
4530TRAC16870363,437363,43716700--1689902/28/214126 Feb 21TermWMWEST MEMPHISPMPM00PWRUNT00TRAC001UNITBB INSP99NA01DUE0.000.000.00$0.003,401,911S0016870012018INTL10/10/17C1LTCSA
YTD Data
Cell Formulas
RangeFormula
G4518:G4528,G4504:G4512G4504=(F4504-AL4504)/(365/12)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
T:TCell Value="A"textNO



Needing help on this one. I want the far right column to count days since "work code" A was used.
So in this, column AR should say "0" for the days A was used (date located on the 6th column, in this case the date is 3/25/21)
Where it is difficult is that not all units at this point have an "A" work code entered so it also has to take into account the unit number is different and thus shouldn't count but rather be blank.
So where column T has "A" and column B = the same unit number, count days elapsed since the date located on column F
If column B doesn't equal the unit number associated with work code "A" and no "A" work code is present, then return blank.

Any help on this will be a game changer for me. Or if you know of another way to track how many days elapsed for each line since work code "A" was entered taking into account the unit number (column B)


Thank you in advance!!
I started with this for cell AR4504 =IF(T4504="A", TODAY()-F4504, "")

But because your table doesn't have the header row, it's hard to follow the rest of what you are referring about "unit number". Which column is the unit number?
 
Upvote 0
Column B is the unit number

So count days elapsed since "A" was inputted for 16869
When 16870 starts, it doesn't start "A" until row 4520 so rows 4518 and 4519 should return blank.
IF 16870 never showed work code "A" in column T then it wouldn't count any days lapsed and would remain blank.
Only when another "A" work code in column T with the unit number in column B matching, would a count be done.
 
Upvote 0
Column B is the unit number

So count days elapsed since "A" was inputted for 16869
When 16870 starts, it doesn't start "A" until row 4520 so rows 4518 and 4519 should return blank.
IF 16870 never showed work code "A" in column T then it wouldn't count any days lapsed and would remain blank.
Only when another "A" work code in column T with the unit number in column B matching, would a count be done.
Thanks, but this is still fuzzy,

"Only when another "A" work code in column T with the unit number in column B matching, would a count be done."

When column B matches what? Also with how you originally expressed it, "So where column T has "A" and column B = the same unit number," (same unit number as what?)

Is each row's Col B unit number being checked for a match against something on the same row? The row above it?
 
Upvote 0
So I'm trying to figure out how many days elapsed since the next work done on the units after "A" (which in a oil change and inspection)
So when 16869 got it's oil change and inspection, how many days lapsed for that unit on each task afterwards?

Here is a smaller version and what it should look like:

2021 Trac System CPM(charles).xlsx
ABCDEFGHIJKLM
1Equip. TypeEquip. IdClosed DateReason CodeReason TextSystem CodeSystem TextAssembly CodeAssembly TextComponent CodeComponent TextWork Acc. CodeColumn1
2TRAC1671702/23/21PMPM00PWRUNT00TRAC001UNITA0
3TRAC1671702/25/21ACACCID14FRAME02BUMPER001ASMBLY032
4TRAC1671702/22/21PMPM00PWRUNT00TRAC001UNITB-1
5TRAC1671702/25/21MAMAINT22AXLE05R DIFF001ASMBLY012
6TRAC1671702/25/21MAMAINT16SUSPEN06DRVAXL001SHOCKF242
7TRAC1671702/25/21MAMAINT18WHLEND01STERAX004SEAL092
8TRAC1671702/25/21MAMAINT13BRKTRA02DRVAXL010SHOE032
9TRAC1671702/25/21MAMAINT13BRKTRA11ABS005TRACVL752
10TRAC1671703/31/21PMPM00PWRUNT00TRAC001UNITB36
11TRAC1671704/23/21PMPM00PWRUNT00TRAC001UNITB59
12TRAC1671704/01/21MAMAINT43EXHSYS03EXHPIP013CLAMP3237
13TRAC1671704/01/21MAMAINT22AXLE05R DIFF001ASMBLY3237
14TRAC1671704/01/21MAMAINT13BRKTRA10AIRSYS056DRYCAR0337
15TRAC1671802/22/21DEDRVERR00PWRUNT00TRAC001UNIT10
16TRAC1671802/23/21MAMAINT43EXHSYS05DPF001FILTER55
17TRAC1671802/23/21MAMAINT43EXHSYS05DPF001FILTER64
18TRAC1671802/25/21MAMAINT13BRKTRA02DRVAXL028SLACK75
19TRAC1671803/05/21MAMAINT44FUELSY04DEF015QLS03
20TRAC1671803/05/21MAMAINT43EXHSYS05DPF001FILTER24
21TRAC1671803/19/21PMPM00PWRUNT00TRAC001UNITB
22TRAC1671903/20/21PMPM00PWRUNT00TRAC001UNITA0
23TRAC1671903/20/21MAMAINT13BRKTRA11ABS069ECU090
24TRAC1671903/21/21ACACCID04AERODY04CABEXT002RIGHT031
25TRAC1671903/20/21MAMAINT16SUSPEN06DRVAXL001SHOCKF030
26TRAC1671903/20/21MAMAINT16SUSPEN06DRVAXL002SHOCKR030
27TRAC1671903/20/21MAMAINT14FRAME02BUMPER013BGBRKT050
28TRAC1671903/20/21MAMAINT13BRKTRA02DRVAXL019BRKCHA030
29TRAC1671903/29/21MAMAINT13BRKTRA07LINES003FITTNG039
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
L1:L29Cell Value="a"textNO



So I know how to get the formula for elapsed days but I don't know how to incorporate the fact it also needs to be unit specific and work code specific.
When saying B = same unit number, it has to match the unit number the work was done on when "A" was used.
So "A" shows up on 16717 in this case and the unit matches B for rows 3 to 14 and so should be calculating how many days elapsed
A different unit number comes into play on row 15 so it should return a blank if it also doesn't contain "A" in column L
If it contained "A" when unit number changes, then all that would happen is that the elapsed time would reset since it is a new unit number.

Hope that makes for a better read.
 
Upvote 0
Maybe something like this (after adjusting the ranges from rows 2:10 to be whatever you need them to be)?

Code:
=IF(MAXIFS($G$2:$G$10,$T$2:$T$10,"A",$B$2:$B$10,B2,$G$2:$G$10,"<"&G2)=0,"",G2-MAXIFS($G$2:$G$10,$T$2:$T$10,"A",$B$2:$B$10,B2,$G$2:$G$10,"<"&G2))

Basically using MAXIFS to find the largest date that was before the current row's date where the same line (column B) had an "A" in column T.

That should work, but it's going to be slow to recalculate. If you need something faster, you could sort your data by line then by descending date first and use a different approach, where calculating the date of the last "A" is easier.
 
Upvote 0
Maybe something like this (after adjusting the ranges from rows 2:10 to be whatever you need them to be)?

Code:
=IF(MAXIFS($G$2:$G$10,$T$2:$T$10,"A",$B$2:$B$10,B2,$G$2:$G$10,"<"&G2)=0,"",G2-MAXIFS($G$2:$G$10,$T$2:$T$10,"A",$B$2:$B$10,B2,$G$2:$G$10,"<"&G2))

Basically using MAXIFS to find the largest date that was before the current row's date where the same line (column B) had an "A" in column T.

That should work, but it's going to be slow to recalculate. If you need something faster, you could sort your data by line then by descending date first and use a different approach, where calculating the date of the last "A" is easier.

I'm not gonna lie, that got my head twisted. :P
I tried rearranging/adjusting but it's not working for me...probably me....trying but still haven't figured it out.
 
Upvote 0
Unfortunately that formula won't work for you as you don't have the maxifs function.
Another option based on the data in post#5
Excel Formula:
=IF(L2="A",0,IFNA(C2-LOOKUP(2,1/(L$2:L2="A")/(B$2:B2=B2),C$2:C2),""))
 
Upvote 0
Solution

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top