View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
joeu2004[_2_] joeu2004[_2_] is offline
external usenet poster
 
Posts: 829
Default Averaging Formula

wrote:
I have 20 days in my sales cycle. As each day passes,
I record a sales figure in the associated cell. My sales
goal is to hit 100 sales for the 20 day period. Given
that, is there a formula that I can use to calculate the
average sales per days that remain that I would need to
make inorder to hit the goal of 100 sales ?


If your sales data are in B2:B21, then:

=IF(COUNT(B2:B21)=20,0,
ROUNDUP(MAX(0,100-SUM(B2:B21))/(20-COUNT(B2:B21)),0))

Note: That assumes that the sales data for the remaining days are left
empty, not zero.

If you would like to see a running average after each day, put the following
formula into C2 and copy down through C21:

=IF(COUNT($B$2:B2)=20,0,
ROUNDUP(MAX(0,100-SUM($B$2:B2))/(20-COUNT($B$2:B2)),0))

The use of ROUNDUP ensures that you do not fall short. But with that
average, you might reach your goal sooner.

The use of MAX ensures that if you already reached your goal, the average is
zero for the remaining days.

The test for COUNT()=20 avoids a #DIV/0 error. Alternatively, if you have
Excel 2007 or later and you do not require Excel 2003 compatibility, you
could write:

=IFERROR(ROUNDUP(MAX(0,100-SUM(B2:B21))/(20-COUNT(B2:B21)),0),0)