View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.newusers
Pieman
 
Posts: n/a
Default Calculating monthly totals for current and previous year

Does anyone know the best formula for totalling values in a column that
correspond to each month of the current and previous year?

I have a sales register with the date of sale and commission on each row but
want to display the total commissions for each month of the current year on
one worksheet and monthly totals for previous year on athother worksheet.

I have tried the following formulas but keep getting a popup box saying that
the formula contains an error:

=SUMPRODUCT(--(MONTH(Websites!B5:B31)=1),--(YEAR(Websites!B5:B31)=YEAR(TODAY())),Websites!R5: R31)

=SUMPRODUCT(--(MONTH(Websites!B5:B31)=1),--(YEAR(Websites!B5:B31)=YEAR(TODAY())-1),Websites!R5:R31)

Any ideas would be greatly appreciated.

Thanks
Simon