Spreadsheet: 106955d1304093395-get-sum-of-one-column-max-of-another-in-pivot-table-add_one_column_take_last_of_other
Sheet: pivot

 |  | Values
DateID | HoldingDate | Sum of Units | Sum of NetProfit
32 | 2002-08-01 08:31:00 | -1 | 87.5
 | 2002-08-01 10:02:01 | -1 | 575
 | 2002-08-01 10:02:02 | 0 | 0
 | 2002-08-01 10:02:03 | 1 | -12.5
 | 2002-08-01 12:00:00 | 1 | -125
 | 2002-08-01 15:15:00 | 1 | -412.5
32 Total |  | 1 | 112.5
33 | 2002-08-02 08:31:00 | 1 | 12.5
 | 2002-08-02 09:16:01 | 1 | -375
 | 2002-08-02 09:16:02 | 0 | 0
 | 2002-08-02 09:16:03 | -1 | -12.5
 | 2002-08-02 12:00:00 | -1 | 875
 | 2002-08-02 12:43:01 | -1 | -250
 | 2002-08-02 12:43:02 | 0 | 0
 | 2002-08-02 12:43:03 | 1 | -12.5
 | 2002-08-02 15:15:00 | 1 | 0
33 Total |  | 1 | 237.5
36 | 2002-08-05 08:31:00 | 1 | -12.5
 | 2002-08-05 12:00:00 | 1 | -1075
 | 2002-08-05 15:15:00 | 1 | -425
36 Total |  | 3 | -1512.5
37 | 2002-08-06 08:31:00 | 1 | 712.5
 | 2002-08-06 09:39:01 | 1 | 975
 | 2002-08-06 09:39:02 | 0 | 0
 | 2002-08-06 09:39:03 | -1 | -12.5
 | 2002-08-06 12:00:00 | -1 | -100
 | 2002-08-06 15:15:00 | -1 | 400
37 Total |  | -1 | 1975
38 | 2002-08-07 08:31:00 | -1 | -625
 | 2002-08-07 12:00:00 | -1 | 587.5
 | 2002-08-07 14:15:01 | -1 | -325
 | 2002-08-07 14:15:02 | 0 | 0
 | 2002-08-07 14:15:03 | 1 | -12.5
 | 2002-08-07 15:15:00 | 1 | 375
38 Total |  | -1 | 0
39 | 2002-08-08 08:31:00 | 1 | 162.5
 | 2002-08-08 12:00:00 | 1 | 312.5
 | 2002-08-08 15:01:01 | 1 | 962.5
 | 2002-08-08 15:01:02 | 0 | 0
 | 2002-08-08 15:01:03 | -1 | -12.5
 | 2002-08-08 15:15:00 | -1 | -12.5
39 Total |  | 1 | 1412.5
40 | 2002-08-09 08:31:00 | -1 | 412.5
 | 2002-08-09 12:00:00 | -1 | -312.5
 | 2002-08-09 15:15:00 | -1 | -275
40 Total |  | -3 | -175
43 | 2002-08-12 08:31:00 | -1 | 675
 | 2002-08-12 09:39:01 | -1 | -200
 | 2002-08-12 09:39:02 | 0 | 0
 | 2002-08-12 09:39:03 | 1 | -12.5
 | 2002-08-12 12:00:00 | 1 | -25
 | 2002-08-12 15:15:00 | 1 | 175
43 Total |  | 1 | 612.5
44 | 2002-08-13 08:31:00 | 1 | -250
 | 2002-08-13 12:00:00 | 1 | 550
 | 2002-08-13 13:29:01 | 1 | -375
 | 2002-08-13 13:29:02 | 0 | 0
 | 2002-08-13 13:29:03 | -1 | -12.5
 | 2002-08-13 15:15:00 | -1 | 775
44 Total |  | 1 | 687.5
45 | 2002-08-14 08:31:00 | -1 | 12.5
 | 2002-08-14 11:57:01 | -1 | -12.5
 | 2002-08-14 11:57:02 | 0 | 0
 | 2002-08-14 11:57:03 | 1 | -12.5
 | 2002-08-14 12:00:00 | 1 | 0
 | 2002-08-14 15:15:00 | 1 | 1637.5
45 Total |  | 1 | 1625
46 | 2002-08-15 08:31:00 | 1 | 250
 | 2002-08-15 08:53:01 | 1 | -12.5
 | 2002-08-15 08:53:02 | 0 | 0
 | 2002-08-15 08:53:03 | -1 | -12.5
 | 2002-08-15 12:00:00 | -1 | -37.5
 | 2002-08-15 15:15:00 | -1 | -312.5
46 Total |  | -1 | -125
47 | 2002-08-16 08:31:00 | -1 | 312.5
 | 2002-08-16 12:00:00 | -1 | -237.5
 | 2002-08-16 15:15:00 | -1 | 50
47 Total |  | -3 | 125
50 | 2002-08-19 08:31:00 | -1 | -12.5
 | 2002-08-19 12:00:00 | -1 | -750
 | 2002-08-19 15:15:00 | -1 | -300
50 Total |  | -3 | -1062.5
51 | 2002-08-20 08:31:00 | -1 | 275
 | 2002-08-20 11:11:01 | -1 | 375
 | 2002-08-20 11:11:02 | 0 | 0
 | 2002-08-20 11:11:03 | 1 | -12.5
 | 2002-08-20 12:00:00 | 1 | 37.5
 | 2002-08-20 15:15:00 | 1 | 175
51 Total |  | 1 | 850
52 | 2002-08-21 08:31:00 | 1 | 287.5
 | 2002-08-21 12:00:00 | 1 | 25
 | 2002-08-21 13:52:01 | 1 | -212.5
 | 2002-08-21 13:52:02 | 0 | 0
 | 2002-08-21 13:52:03 | -1 | -12.5
 | 2002-08-21 15:01:01 | -1 | -412.5
 | 2002-08-21 15:01:02 | 0 | 0
 | 2002-08-21 15:01:03 | 1 | -12.5
 | 2002-08-21 15:15:00 | 1 | 100
52 Total |  | 3 | -237.5
53 | 2002-08-22 08:31:00 | 1 | -25
 | 2002-08-22 10:48:01 | 1 | 287.5
 | 2002-08-22 10:48:02 | 0 | 0
 | 2002-08-22 10:48:03 | -1 | -12.5
 | 2002-08-22 12:00:00 | -1 | 50
 | 2002-08-22 15:15:00 | -1 | -225
53 Total |  | -1 | 75
54 | 2002-08-23 08:31:00 | -1 | 300
 | 2002-08-23 10:02:01 | -1 | 262.5
 | 2002-08-23 10:02:02 | 0 | 0
 | 2002-08-23 10:02:03 | 1 | -12.5
 | 2002-08-23 11:34:01 | 1 | -312.5
 | 2002-08-23 11:34:02 | 0 | 0
 | 2002-08-23 11:34:03 | -1 | -12.5
 | 2002-08-23 12:00:00 | -1 | -75
 | 2002-08-23 13:29:01 | -1 | -200
 | 2002-08-23 13:29:02 | 0 | 0
 | 2002-08-23 13:29:03 | 1 | -12.5
 | 2002-08-23 15:15:00 | 1 | -400
54 Total |  | -1 | -462.5
57 | 2002-08-26 08:31:00 | 1 | 175
 | 2002-08-26 12:00:00 | 1 | -437.5
 | 2002-08-26 15:15:00 | 1 | 612.5
57 Total |  | 3 | 350
58 | 2002-08-27 08:31:00 | 1 | 287.5
 | 2002-08-27 08:53:01 | 1 | -200
 | 2002-08-27 08:53:02 | 0 | 0
 | 2002-08-27 08:53:03 | -1 | -12.5
 | 2002-08-27 12:00:00 | -1 | 362.5
 | 2002-08-27 15:15:00 | -1 | 312.5
58 Total |  | -1 | 750
59 | 2002-08-28 08:31:00 | -1 | 387.5
 | 2002-08-28 12:00:00 | -1 | 437.5
 | 2002-08-28 14:38:01 | -1 | -75
 | 2002-08-28 14:38:02 | 0 | 0
 | 2002-08-28 14:38:03 | 1 | -12.5
 | 2002-08-28 15:15:00 | 1 | -250
59 Total |  | -1 | 487.5
60 | 2002-08-29 08:31:00 | 1 | -462.5
 | 2002-08-29 12:00:00 | 1 | 750
 | 2002-08-29 15:15:00 | 1 | -262.5
60 Total |  | 3 | 25
61 | 2002-08-30 08:31:00 | 1 | -312.5
 | 2002-08-30 12:00:00 | 1 | 775
 | 2002-08-30 15:15:00 | 1 | -675
61 Total |  | 3 | -212.5
Grand Total |  | 6 | 5537.5