Spreadsheet: 150368d1334483652-when-2-columns-meet-criteria-find-the-max-in-another-column-and-subtract-from-another-col-example3
Sheet: 2012_V

 |  |  |  | SALES |  |  |  |  |  |  |  |  |  |  |  | RT 1 | RT 2 | RT 3 | RT H | CS | AK | NS | HS |  | RT 1
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | RT 2
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | RT 3
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | SCHOOLS | HOTELS | P/V | REGULAR |  |  |  |  |  | HOUSE
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | DRINKS
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | SNACK |  |  |  | PEPSI |  |  |  | COKE |  |  |  | COFFEE |  |  |  | COLD FOOD |  |  |  | [NAME]
R T . | DATE . | D A Y | W K . | M O . | Q T R | E O 1 | G R O U P | C L A S S | S O U R C E | S A L E S | C # | CUSTOMER | BANK | RT PER      . | ADD EQUIP | NET VEND | SNACK | PEPSI | COKE | COFFEE | C/F | F/F | GROSS VEND | ADJ COMM | ADJ SUBSIDY |  | REF BAG | CHG TOT | 5 | 10 | 25 | $ | 5 | 10 | 25 | $ | 5 | 10 | 25 | $ | 5 | 10 | 25 | $ | 5 | 10 | 25 | $ | 5 | 10 | 25 | $ |  | COMM VOL 1 | COMM VOL 2
2 | 2012-01-09 00:00:00 | 1 | 2 | 1 | 1 |  | HH | H |  |  | 165 | [NAME] | 1 | LS |  | 145.6728 | 37.6 |  | 141.8 |  |  |  | 179.4 | -33.7272 |  |  |  | 0 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 179.4
2 | 2012-01-12 00:00:00 | 4 | 2 | 1 | 1 |  | HH | H |  |  | 165 | [NAME] | 1 | BB |  | 62.2804 | 18.75 |  | 57.95 |  |  |  | 76.7 | -14.4196 |  |  |  | 0 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 76.7
2 | 2012-01-19 00:00:00 | 4 | 1 | 1 | 1 |  | HH | H |  |  | 165 | [NAME] | 3 | BB |  |  |  |  | 185
2 | 2012-01-26 00:00:00 | 4 | 4 | 4 | 1 |  | HH | H |  |  | 165 | [NAME] | 3 | BB |  |  |  |  | 197
2 | 2012-01-19 00:00:00 | 4 | 3 | 1 | 1 |  | HH | H |  |  | 165 | [NAME] | 1 | BB |  | 63.133 | 0 |  | 77.75 |  |  |  | 77.75 | -14.617 |  |  |  | 0 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 77.75
2 | 2012-01-24 00:00:00 | 2 | 4 | 1 | 1 |  | HH | H |  |  | 165 | [NAME] | 1 | BB |  | 28.9478 | 35.65 |  | 0 |  |  |  | 35.65 | -6.702199999999999 |  |  |  | 0 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 35.65
2 | 2012-01-26 00:00:00 | 4 | 4 | 1 | 1 |  | HH | H |  |  | 165 | [NAME] | 1 | CS |  | 90.9846 | 22.5 |  | 89.55 |  |  |  | 112.05 | -21.0654 |  |  |  | 0 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 112.05
2 | 2012-02-02 00:00:00 | 4 | 5 | 2 | 1 |  | HH | H |  |  | 165 | [NAME] | 1 | BB |  | 44.254 | 17.5 |  | 37 |  |  |  | 54.5 | -10.246 |  |  |  | 0 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 54.5
2 | 2012-02-09 00:00:00 | 4 | 6 | 2 | 1 |  | HH | H |  |  | 165 | [NAME] | 1 | BB |  | 110.1884 | 38.65 |  | 97.05 |  |  |  | 135.7 | -25.5116 |  |  |  | 0 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 135.7
2 | 2012-02-16 00:00:00 | 4 | 7 | 2 | 1 |  | HH | H |  |  | 165 | [NAME] | 1 | BB |  | 91.5124 | 7.95 |  | 104.75 |  |  |  | 112.7 | -21.1876 |  |  |  | 0 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 112.7
2 | 2012-02-23 00:00:00 | 4 | 8 | 2 | 1 |  | HH | H |  |  | 165 | [NAME] | 1 | BB |  | 111.4064 | 42.2 |  | 95 |  |  |  | 137.2 | -25.7936 |  |  |  | 0 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 137.2
2 | 2012-03-01 00:00:00 | 4 | 9 | 3 | 1 |  | HH | H |  |  | 165 | [NAME] | 1 | BB |  | 137.0656 | 56.15 |  | 112.65 |  |  |  | 168.8 | -31.7344 |  |  |  | 0 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 168.8
2 | 2012-03-08 00:00:00 | 4 | 10 | 3 | 1 |  | HH | H |  |  | 165 | [NAME] | 1 | BB |  | 214.977 | 72.3 |  | 192.45 |  |  |  | 264.75 | -49.773 |  |  |  | 0 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 264.75
2 | 2012-03-15 00:00:00 | 4 | 11 | 3 | 1 |  | HH | H |  |  | 165 | [NAME] | 1 | BB |  | 105.1946 | 60.8 |  | 68.75 |  |  |  | 129.55 | -24.3554 |  |  |  | 0 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 129.55
2 | 2012-03-22 00:00:00 | 4 | 12 | 3 | 1 |  | HH | H |  |  | 165 | [NAME] | 1 | BB |  | 41.4932 | 51.1 |  | 0 |  |  |  | 51.1 | -9.6068 |  |  |  | 0 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 51.1
2 | 2012-03-29 00:00:00 | 4 | 13 | 3 | 1 |  | HH | H |  |  | 165 | [NAME] | 1 | BB |  | 197.1536 | 59.15 |  | 183.65 |  |  |  | 242.8 | -45.6464 |  |  |  | 0 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 242.8
2 | 2012-04-05 00:00:00 | 4 | 14 | 4 | 1 |  | HH | H |  |  | 165 | [NAME] | 1 | BB |  | 325.0436 | 100.5 |  | 299.8 |  |  |  | 400.3 | -75.2564 |  |  |  | 0 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 400.3