The AVERAGE and SUM functions are nested within the IF function. You can nest up to 64 levels of functions in a formula.