View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] jsollows@gmail.com is offline
external usenet poster
 
Posts: 8
Default Sum for last calendar month & year

Thanks for the tip but I don't think it's quite what I need. The
spreadsheet column H containes dates for all entries. I want to produce
a sum of column J for all entries dated in the last calendar month
without the need to specify the month.

Jim


Ron Coderre wrote:
Try something like this:

With
Dates in A1:A40
Values in B1:B40

The total for the month prior to today's month:
C1: =SUMPRODUCT(--(TEXT(A1:A40,"yyyymm")=TEXT(TODAY()-DAY(TODAY()),"yyyymm")))

The total for the year prior to today's year:
C2: =SUMPRODUCT(--(YEAR(A1:A40)=(YEAR(TODAY())-1)))

Does that help?
***********
Regards,
Ron

XL2002, WinXP


" wrote:

I have a spreadsheet with column H = date and column J is a numerical
value. I am looking for a way to sum all entries in the last calendar
month and also for the last calendar year (Jan1 -Dec 31).

Can anyone help me with this?


Jim