Functions EARLIER and EARLIEST
Formula in calculated column will be evaluated using the row context, which means that all columns that are referenced give results in a row in which the formula is located. Evaluation continues for each subsequent row, so that by the end of the table. Since calculating final sum takes place iteratively we can hardly see what happened in the previous row as you would do in traditional Excel formulas. Here come into play EARLIER and EARLIEST functions.