Relationships Among Formulas and Variables. This diagram shows two variables, SALES_VARIABLE and COST_VARIABLE. The SALES formula uses an AGGREGATE function against the SALES_VARIABLE variable. The SALES_PCTCHG formula uses a LAGPCT function against the SALES formula. The COST formula uses an AGGREGATE function against the COST_VARIABLE variable. The COST_PP formula uses a LAG function against the COST formula. The PROFIT formula uses the equation SALES-COST.