View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Eduardo Eduardo is offline
external usenet poster
 
Posts: 2,276
Default Xlookup that returns variable sum data

Hi David,
I am confuse here, if todays date is 11/20 the result of you formula never
can be 11 since you are looking the sum of all the entries prior to that
date. let's say in
column A row 1 you have the Today date, then in column A row 4 you have
different dates all the way down and in column B you have the values.
Do this

In column B add a formula =A1-30. This will calculate todays day minus 30 days
Then in the cell you want to summarize the movement for the prior 30 days
enter

=SUMPRODUCT(--(A:A<A1),--(A:A=B1),--B:B)

"David G." wrote:

I am trying to create a formula that looks for todays date in a table and
returns the sum of daily entries for the month prior to the date. In the
sample below =vlookup(E1,A1:C2,2) instead of returning 6 value from row #2,
it will return 11, the sum of all values prior to the one assigned to the
date. Furthermore, can I set it to change the range tomorrow, adding yet
another cell to the sum for a return of 14?

1 2

A 11/20 5

B 11/21 6

C 11/22 3

D

E 11/20

Thanks