I just ran into another problem with my formula. I want the formula to eliminate the blank cells. In other words, if there are three rows for one order, and one of the rows does not contain a number, I want the average to equal the sum of the cells divided by two, not three. How can I do that? Below is the formula that I have now.
=SUM(SUMIF(Sheet1!$C$2:$C$850, Sheet2!A777, Sheet1!$G$2:$G$850)/ COUNTIF(Sheet1!$C$2:$C$850, Sheet2!A777))