Trying to get last data point on particular item in a pivot table

kgarland17

New Member
Joined
Jun 17, 2021
Messages
8
Office Version
  1. 365
Platform
  1. Windows
I have a database that has invoicing data and booking, but the booking is missing a crucial piece of data that doesn't become active until it is invoiced.
So I created a pivot table of invoiced data to attempt to be able to get a formula into the booking portion of database. Perhaps this isn't the way to go? Not sure.

=IF(INDEX(Pivot Table!$A$2:$S$8,MATCH(SourceDB!a2,Pivot Table!$A$3:$A$8,0),19)=0,INDEX(Pivot Table!$A$3:$S$8,MATCH(SourceDB!a2,Pivot Table!$A$2:$a$8,0),18),INDEX(Cost_Book_Gap!$A$3:$S$8,MATCH(SourceDB!a2,Pivot Table!$A$2:$A$8,0),19))

Is there any easier way/better formula to go about this?

Invoice DateCategoryneed formula in cells below
6/11/2021​
########​
6/14/2021​
1113​
6/11/2021​
########​
6/14/2021​
2223​
4/22/2021​
########​
6/16/2021​
2224​
2/17/2021​
########​
6/25/2021​
2224​
4/5/2021​
########​
6/30/2021​
2223​
4/30/2021​
7/2/2021​
7/2/2021​
1114​
1/6/2021​
########​
7/14/2021​
1112​
6/8/2021​
8/2/2021​
8/2/2021​
2222​
6/2/2021​
########​
8/12/2021​
1113​
3/31/2021​
########​
11/1/2021​
2223​

Data to pull last non-zero data point by category
20202021
CategoryJanFebMarAprMayJunJulAugSepOctNovDecJanFebMarAprMayJun
1111
0​
0​
273.77​
0​
0​
0​
0​
0​
0​
274.32​
0​
0​
0​
0​
0​
0​
291.92​
0​
1112
253.11​
0​
264.41​
265.8372​
266.84​
266.8555​
288.67​
293.67​
280.9331​
0​
293.67​
0​
285.3423​
284.3644​
289.3794​
290.54​
290.14​
292.28​
1113
196.63​
197.85​
197.31​
199.03​
199.89​
0​
199.9​
0​
228.58​
0​
0​
225.12​
219.25​
219.3067​
219.2574​
219.85​
217.98​
0​
2222
0​
0​
0​
0​
0​
125.61​
0​
135.83​
0​
0​
0​
135.99​
0​
0​
136.0933​
0​
0​
0​
2223
0​
0​
121.6067​
121.75​
121.07​
122.9062​
125.79​
135.181​
134.9914​
133.886​
133.0498​
133.1605​
134.6252​
133.0939​
133.1253​
134.1776​
133.4153​
133.033​
2224
0​
0​
120.88​
0​
120.5004​
120.414​
120.04​
135.3226​
135.939​
133.8736​
132.7633​
132.7174​
132.706​
132.84​
132.9839​
132.9091​
132.9527​
132.62​
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Source data:
MRX_TEST.xlsx
ABCDEF
1Ordered DateActual Shipment DateRequest DateInvoice DateItem NumberValue w/ Formulas in Yellow cells needed below
211/9/20191/9/20201/9/20201114196.63
311/9/20191/9/20201/9/20201114196.63
41/13/2020########1/14/20201113253.11
511/18/2019########1/16/20201114196.63
62/10/2020########2/11/20201114197.85
79/18/20193/3/20203/3/20201113264.41
82/25/20203/4/20203/4/20202224120.88
92/5/20203/4/20203/4/20202224120.88
102/5/20203/4/20203/4/20202224120.88
111/9/20203/5/20203/5/20201114197.31
122/12/20203/5/20203/5/20202223121.81
132/14/20203/9/20203/9/20202223121.78
142/20/2020########3/11/20202223121.78
153/4/2020########3/12/20202223121.46
161/15/2020########3/16/20201111281.83
171/15/2020########3/16/20201113264.41
183/5/2020########3/16/20202223121.46
196/18/2019########3/30/20201112273.77
201/21/20204/6/20204/6/20201113265.82
213/16/20204/7/20204/7/20202223121.75
223/18/20204/8/20204/8/20202223121.75
232/21/2020########4/14/20201113265.82
242/21/2020########4/14/20201113265.82
252/17/2020########4/16/20201114199.03
2610/1/2019########4/20/20201113265.82
274/28/2020########4/28/20201113266.63
282/21/20205/4/20205/4/20201113266.84
292/21/20205/4/20205/4/20201113266.84
303/26/20205/7/20205/7/20202224120.69
313/31/2020########5/15/20201113266.84
322/7/2020########5/27/20201113266.84
335/14/2020########5/27/20202224120.39
345/21/2020########5/28/20202224120.38
353/30/2020########5/29/20201114199.89
364/20/2020########5/29/20202223121.07
374/17/2020########5/29/20202223121.07
384/22/2020########5/29/20202223121.07
395/1/20206/1/20206/1/20202223121.07
404/27/20206/1/20206/1/20202223121.07
415/5/20206/1/20206/1/20202223121.07
422/14/20206/3/20206/3/20201113266.84
431/7/20206/9/20206/9/20201113266.82
442/6/2020########6/10/20201113266.82
455/5/2020########6/11/20202223121.07
465/1/2020########6/16/20202224120.36
475/11/2020########6/17/20202223121.07
485/7/2020########6/18/20202223121.07
495/8/2020########6/19/20202223121.07
505/11/2020########6/20/20202224120.36
515/8/2020########6/20/20202224120.36
526/11/2020########6/23/20201113266.93
535/13/2020########6/24/20202223127.09
545/14/2020########6/25/20202223127.09
555/5/2020########6/25/20202223127.09
565/26/2020########6/25/20202224120.44
576/4/2020########6/25/20202224120.44
585/22/2020########6/25/20202224120.44
595/5/2020########6/25/20202224120.44
604/30/2020########6/26/20202222125.61
615/19/2020########6/26/20202223127.09
625/19/2020########6/26/20202223127.09
635/14/2020########6/26/20202224120.44
645/26/2020########6/27/20202223127.09
656/16/2020########6/29/20202223127.09
664/22/2020########6/30/20202223121.28
675/20/2020########6/30/20202223121.28
685/19/2020########6/30/20202223121.28
695/19/2020########6/30/20202223121.28
704/10/20207/1/20207/1/20201114199.9
715/19/20207/1/20207/1/20202223121.28
726/21/20207/8/20207/8/20202223121.13
737/1/20207/8/20207/8/20202223121.13
745/22/2020########7/11/20202223121.13
755/29/2020########7/11/20202224120.04
765/29/2020########7/11/20202224120.04
776/3/2020########7/14/20202224120.04
786/8/2020########7/16/20202223121.13
796/15/2020########7/22/20202223121.13
806/24/2020########7/23/20202223121.13
817/8/2020########7/23/20202223121.13
827/14/2020########7/23/20202223121.13
837/6/2020########7/23/20202223121.13
847/7/2020########7/23/20202223121.13
857/14/2020########7/23/20202223121.13
866/24/2020########7/30/20201113288.67
877/29/2020########7/30/20202223137
886/25/2020########7/30/20202223194.25
897/31/20208/1/20208/1/20202223137
907/10/20208/4/20208/4/20201113293.67
916/25/20208/5/20208/5/20202223133.28
927/31/20208/6/20208/6/20202223133.28
938/3/20208/7/20208/7/20202223133.05
947/1/20208/7/20208/7/20202223133.05
957/1/2020########8/10/20202223132.99
966/29/2020########8/11/20202222135.83
976/29/2020########8/11/20202223132.99
988/11/2020########8/12/20202223132.99
998/13/2020########8/17/20202224135.33
1008/11/2020########8/18/20202223135.47
1016/18/2020########8/18/20202224135.33
1028/11/2020########8/18/20202224135.32
1038/19/2020########8/20/20202223135.28
1048/20/2020########8/21/20202223135.28
1057/23/2020########8/21/20202223135.28
1068/17/2020########8/24/20202223135.28
1078/21/2020########8/24/20202223135.28
1087/13/2020########8/25/20202223135.28
1098/20/2020########8/26/20202223191.72
1107/15/2020########8/26/20202224135.32
1115/11/2020########8/27/20201113293.67
1128/26/2020########8/27/20202223135.28
1138/26/2020########8/27/20202223135.28
1148/26/2020########8/27/20202224135.32
1157/16/2020########8/28/20202224135.32
1169/1/20209/2/20209/2/20202223134.87
1177/22/20209/3/20209/3/20202223134.73
1187/17/20209/3/20209/3/20202223134.73
1197/23/20209/4/20209/4/20202223134.8
1207/9/2020########9/10/20201114228.58
1219/2/2020########9/11/20202223135.21
1229/3/2020########9/14/20202223135.21
1238/13/2020########9/15/20201113284.47
1249/4/2020########9/15/20202223135.21
1256/10/2020########9/16/20201113279.51
1267/28/2020########9/16/20202223135.21
1278/7/2020########9/16/20202224135.93
1289/9/2020########9/17/20202224135.93
1299/17/2020########9/18/20202224135.93
1308/13/2020########9/23/20202223136.92
1319/23/2020########9/25/20201113279.72
1329/11/2020########9/25/20202223135.81
1338/17/2020########9/25/20202224136.12
1349/28/2020########9/29/20202224135.09
1359/29/2020########9/30/20202224135.09
1369/24/2020########10/1/20202223135.43
1379/27/2020########10/2/20202224135.09
13810/2/2020########10/6/20202223135.43
1399/30/2020########10/8/20202223133.96
1408/20/2020########10/13/20201112274.32
14110/5/2020########10/13/20202223134.02
14210/5/2020########10/13/20202223134.02
14310/7/2020########10/15/20202224133.08
1448/31/2020########10/16/20202223133.47
14510/9/2020########10/20/20202223133.24
14610/13/2020########10/21/20202223133.24
14710/12/2020########10/23/20202223133.24
14810/12/2020########10/23/20202223133.24
14910/14/2020########10/24/20202223133.24
15010/15/2020########10/24/20202223133.24
15110/14/2020########10/24/20202223133.24
1529/2/2020########10/26/20202223133.24
15310/20/2020########10/27/20202223133.24
15410/13/2020########10/27/20202224133.06
1559/15/2020########10/28/20202223133.24
15610/23/2020########10/28/20202223133.24
15710/23/2020########10/28/20202224133.06
15810/21/2020########10/28/20202224133.06
15910/13/2020########10/28/20202224133.06
1609/28/2020########10/28/20202224133.06
1618/19/2020########10/29/20201112274.32
16210/27/2020########10/30/20202223133.24
16311/5/2020########11/6/20202224133.06
16411/9/2020########11/9/20202223133.06
1659/24/2020########11/9/20202223133.06
16611/2/2020########11/9/20202223133.06
16711/3/2020########11/9/20202223133.06
16811/3/2020########11/9/20202223133.06
1699/24/2020########11/9/20202224132.77
17010/14/2020########11/9/20202224132.77
17110/23/2020########11/9/20202224132.77
17211/9/2020########11/10/20202223133.24
1739/24/2020########11/10/20202224132.76
17411/3/2020########11/11/20202223133.03
17510/5/2020########11/12/20202223133.03
17611/5/2020########11/12/20202223133.03
17711/10/2020########11/13/20202223133.03
17811/12/2020########11/16/20202223133.01
1796/23/2020########11/19/20201113293.67
18011/16/2020########11/19/20202224132.65
18111/18/2020########11/20/20202223132.99
18211/20/2020########11/20/20202223132.99
18311/23/2020########11/23/20202223132.99
18411/18/2020########11/23/20202223133.24
18511/24/2020########11/25/20202223132.94
18610/23/2020########12/1/20202222135.99
18711/19/2020########12/1/20202223132.94
18811/19/2020########12/3/20202223132.88
18912/2/2020########12/3/20202223132.88
19011/11/2020########12/3/20202223132.88
1919/23/2020########12/4/20202223132.88
19212/1/2020########12/8/20202224132.52
19312/4/2020########12/9/20202224132.52
19410/29/2020########12/15/20202223132.89
19510/29/2020########12/15/20202223132.89
19612/15/2020########12/15/20202223132.89
19712/1/2020########12/15/20202223132.89
19812/11/2020########12/15/20202223132.89
19911/3/2020########12/15/20202223132.89
20011/6/2020########12/16/20202223132.89
20111/12/2020########12/18/20202224132.59
20212/21/2020########12/22/20202223133.24
20312/10/2020########12/22/20202223132.89
20412/3/2020########12/22/20202223169.03
20512/21/2020########12/22/20202224133.06
20612/10/2020########12/22/20202224132.69
2079/9/2020########12/29/20201114225.12
20811/30/2020########12/29/20202224132.7
20912/9/2020########12/29/20202224132.7
21012/17/2020########12/30/20202223132.96
21112/18/2020########12/30/20202223133.24
21212/10/2020########12/30/20202223133.24
21312/10/2020########12/30/20202223133.24
21412/30/2020########12/30/20202224133.06
21512/16/2020########12/31/20202223132.96
21611/18/20201/5/20211/5/20211113287.74
21711/19/20201/8/20211/8/20211111293.83
21812/21/20201/8/20211/8/20212223132.96
21912/29/20201/8/20211/8/20212223132.96
22010/13/2020########1/11/20211114219.25
22112/28/2020########1/11/20212223132.96
22211/24/2020########1/13/20212223132.97
22311/18/2020########1/13/20212224132.7
22412/4/2020########1/15/20211113284.32
22512/1/2020########1/15/20212223132.97
2261/11/2021########1/19/20212223133.17
22712/3/2020########1/21/20212224132.7
22811/18/2020########1/25/20212223168.81
22912/3/2020########1/26/20211113284.32
2301/7/2021########1/27/20212224132.78
23110/30/2020########1/29/20211113284.18
2321/11/2021########1/29/20212223133.07
23312/17/2020########1/29/20212223133.07
2341/7/2021########1/29/20212224132.84
23510/30/20202/1/20212/1/20211113284.18
23611/16/20202/1/20212/1/20211114219.26
2371/12/20212/1/20212/1/20212224132.84
2382/1/20212/2/20212/2/20212223133.07
2391/19/20212/3/20212/3/20212223133.07
2401/12/20212/3/20212/3/20212223133.07
2411/15/20212/3/20212/3/20212224132.84
24212/22/20202/3/20212/3/20212224132.84
2432/9/20212/9/20212/9/20212223133.13
2442/9/2021########2/11/20212223133.13
24512/29/2020########2/15/20212223133.07
24612/28/2020########2/17/20212224132.84
24712/7/2020########2/18/20211114219.36
2481/7/2021########2/18/20212224132.84
2491/7/2021########2/18/20212224132.84
2501/7/2021########2/18/20212224132.84
2511/7/2021########2/18/20212224132.84
2521/7/2021########2/18/20212224132.84
25312/30/2020########2/18/20212224132.84
2542/2/2021########2/24/20212223133.07
2551/14/2021########2/25/20211113288.79
2562/8/2021########2/25/20212223133.07
2572/15/2021########2/25/20212223133.07
2582/3/2021########2/25/20212223133.07
2592/11/2021########2/26/20212223133.07
26012/29/20203/1/20213/1/20212222136.08
2611/13/20213/1/20213/1/20212223133.13
2622/1/20213/1/20213/1/20212224132.92
2631/25/20213/2/20213/2/20211113288.78
2641/7/20213/2/20213/2/20212224132.92
2651/6/20213/3/20213/3/20212224132.97
2661/21/20213/4/20213/4/20212223133.07
2673/4/20213/4/20213/4/20212223133.13
2681/7/20213/4/20213/4/20212224132.97
2691/12/20213/5/20213/5/20211114219.85
2701/24/20213/5/20213/5/20212222136.1
2711/28/20213/9/20213/9/20211113289.37
2723/9/20213/9/20213/9/20212223133.13
2733/5/2021########3/10/20212223133.13
2742/16/2021########3/10/20212223133.13
2752/4/2021########3/10/20212223133.13
2762/19/2021########3/10/20212223133.13
2773/2/2021########3/10/20212223133.13
2782/24/2021########3/10/20212224133.06
2792/23/2021########3/10/20212224133.06
2801/31/2021########3/10/20212224133.06
2813/8/2021########3/10/20212224133.06
2823/4/2021########3/11/20212223133.13
2833/1/2021########3/11/20212223133.13
2842/17/2021########3/11/20212223133.13
2852/16/2021########3/11/20212224133.06
2861/31/2021########3/11/20212224133.06
2871/19/2021########3/17/20211114218.85
2883/19/2021########3/19/20212223133.13
2892/3/2021########3/23/20211113290.11
2903/18/2021########3/24/20212223133.13
2913/10/2021########3/29/20212223133.12
2922/19/2021########3/29/20212224132.91
2932/25/2021########3/29/20212224132.91
2943/12/20214/1/20214/1/20212223133.13
2953/4/20214/5/20214/5/20212223133.16
2963/25/20214/5/20214/5/20212223133.13
2973/18/20214/5/20214/5/20212223133.13
2983/9/20214/5/20214/5/20212224132.89
2993/4/20214/5/20214/5/20212224132.89
3003/9/20214/6/20214/6/20212223167.72
3012/25/20214/6/20214/6/20212224132.89
3022/23/20214/8/20214/8/20212223133.16
3034/8/20214/8/20214/8/20212223133.13
3042/23/2021########4/14/20211114219.85
3053/19/2021########4/14/20212224132.73
3063/17/2021########4/16/20212223133.14
3073/17/2021########4/19/20212223133.14
3083/10/2021########4/20/20211113290.54
3094/20/2021########4/20/20212224133.06
3103/30/2021########4/22/20212223133.2
3113/30/2021########4/23/20212223133.2
3123/25/2021########4/23/20212223133.2
3133/24/2021########4/29/20212223166.5
3143/22/20215/3/20215/3/20212223133.42
3154/5/20215/3/20215/3/20212223133.42
3163/24/20215/4/20215/4/20211112291.92
3173/24/20215/4/20215/4/20212223133.42
3184/6/20215/4/20215/4/20212223133.42
3194/6/20215/5/20215/5/20212223133.42
3203/25/20215/5/20215/5/20212223133.42
3214/12/20215/6/20215/6/20212223133.42
3224/9/20215/7/20215/7/20212224132.95
3234/12/20215/7/20215/7/20212224132.95
3244/13/2021########5/10/20212224132.95
3254/20/2021########5/11/20212223133.42
3264/13/2021########5/11/20212224132.95
3274/14/2021########5/12/20212223133.42
3284/19/2021########5/12/20212224132.95
3294/18/2021########5/12/20212224132.95
3304/2/2021########5/12/20212224132.95
3314/10/2021########5/13/20211113289.98
3324/19/2021########5/13/20212223133.42
3334/23/2021########5/17/20212223133.36
3344/21/2021########5/18/20212223133.36
3353/1/2021########5/19/20212223133.36
3365/20/2021########5/21/20212224133.06
3371/22/2021########5/26/20211114217.98
3384/13/2021########5/27/20211113290.3
3394/16/2021########5/28/20212224132.95
3403/3/20216/3/20216/2/20216/3/20211113292.28
3415/10/20216/7/2021########6/7/20212223132.95
3425/12/20216/7/2021########6/7/20212223132.95
3435/7/20216/7/2021########6/7/20212224132.62
3444/21/20216/8/2021########6/8/20212223132.95
3455/11/20216/8/2021########6/8/20212223132.95
3464/19/20216/8/2021########6/8/20212224132.62
3475/5/20216/9/20215/6/20216/9/20212223132.95
3484/16/20216/9/2021########6/9/20212223132.95
3495/5/20216/9/20215/6/20216/9/20212223132.95
3505/13/20216/9/2021########6/9/20212223132.95
3515/3/20216/9/20215/4/20216/9/20212223132.95
3524/21/20216/9/2021########6/9/20212223132.95
3535/13/20216/9/2021########6/9/20212223132.95
3544/27/20216/9/2021########6/9/20212223132.95
3555/4/20216/9/20215/5/20216/9/20212223132.95
3564/30/20216/9/20215/3/20216/9/20212223132.95
3574/22/20216/9/2021########6/9/20212223132.95
3585/10/20216/9/2021########6/9/20212223132.95
3595/5/20216/9/2021########6/9/20212224132.62
3605/5/20216/9/20215/6/20216/9/20212224132.62
3615/3/20216/9/20215/4/20216/9/20212224132.62
3624/22/2021################6/10/20212223133.01
3634/12/2021################6/10/20212223132.95
3645/18/2021################6/10/20212224132.62
3654/2/2021########4/5/20216/11/20212223133.1
366need formula
3676/11/2021########6/14/20211113
3686/11/2021########6/14/20212223
3694/22/2021########6/16/20212224
3702/17/2021########6/25/20212224
3714/5/2021########6/30/20212223
3724/30/20217/2/20217/2/20211114
3731/6/2021########7/14/20211112
3746/8/20218/2/20218/2/20212222
3756/2/2021########8/12/20211113
3763/31/2021########11/1/20212223
SourceDB
 
Upvote 0
MRX_TEST.xlsx
ABCDEFGHIJKLMNOPQRS
120202021
2Row LabelsJanFebMarAprMayJunJulAugSepOctNovDecJanFebMarAprMayJun
3111100273.77000000274.32000000291.920
41112253.110264.41265.8372266.84266.8555288.67293.67280.93310293.670285.3423284.3644289.3794290.54290.14292.28
51113196.63197.85197.31199.03199.890199.90228.5800225.12219.25219.3067219.2574219.85217.980
6222200000125.610135.83000135.9900136.0933000
7222300121.6067121.75121.07122.9062125.79135.181134.9914133.886133.0498133.1605134.6252133.0939133.1253134.1776133.4153133.033
8222400120.880120.5004120.414120.04135.3226135.939133.8736132.7633132.7174132.706132.84132.9839132.9091132.9527132.62
Pivot Table
 
Upvote 0

Forum statistics

Threads
1,215,857
Messages
6,127,374
Members
449,382
Latest member
DonnaRisso

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