View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default sum certain columns

geebee,

With dates in column A, and values to sum in column B, both starting in Row 2 (headers in row 1) in
C2 use the formula

=SUMPRODUCT((YEAR($A$2:$A2)=YEAR(A2))*$B$2:B2)

And then copy down to match your data set. This assumes that the dates are sorted ascending.

HTH,
Bernie
MS Excel MVP


"geebee" (noSPAMs) wrote in message
...
hi,

i have a sheet with severasl rows in it. each row corresponds to a certain
month and year. ranging from jan-04 through mar-08. i would like to add a
new column to the worksheet, and have it have a formula for the YTD sum. so
how can i make it to where the new column only adds the amounts for months in
the current year? can this be programatically done?

thanks in advance,
geebee