View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Lars-Åke Aspelin[_2_] Lars-Åke Aspelin[_2_] is offline
external usenet poster
 
Posts: 913
Default Automatically calculate the previous days total 'sales'

On Fri, 17 Jul 2009 02:08:16 -0700, PVANS
wrote:

Good morning, I hope someone can help.

I have a worksheet that has the following three columns:
Date Reciept Price

The worksheet is compiled automatically from information coming from the
primary worksheet in the workbook.

The date is generated each day using the =today() function.

What I need to happen is at the start of a new day, a macro that totals all
of the amounts in the previous days prices.

I will give a mini view of what the worksheet looks like:
Date Reciept Price
16/07/09 1 100
16/07/09 2 100
16/07/09 3 100
17/07/09 4 100
17/07/09 5 100

Therefore, I wish the formula to automatically add each days total prices
together and show the answer in a new cell. I found that the SumIF formula
will do a single days result, however I need this to happen every day without
me needing to code a macro for each specific date.

Thanks in advance for the help


If your data is in column A to C starting on row 2 (with the headers
on row 1) try the following formula in cell D2:

=IF(A2<A3,SUMPRODUCT((C$2:C$1000)*(A$2:A$1000=A2) ),"")

Copy the formula down as far as you (will) have data in columns A to C
Change the 1000 to fit your maximum number of data rows as well.

The result in column D will be a daily sum next to the last entry for
each specific date.

Hope this helps / Lars-Åke