View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Trevor Shuttleworth Trevor Shuttleworth is offline
external usenet poster
 
Posts: 1,089
Default SumProduct or Array Function for summing by month and year

Don

I put another bracket in after SUMPRODUCT and Excel forces another at the
end. It would seem this isn't needed but doesn't do any harm.

I know this should be more straightforward than it is working out but I
can't see what is wrong.

Could I send you the workbook to check first hand? It's something I'm
putting together for my wife so it's only got test data. There is a short
macro to generate an Invoice Number but other than that there's no code.

Thanks

Trevor

"Don Guillett" wrote in message
...
It appears that you also forgot a ( right after SUMPRODUCT



=SUMPRODUCT(YEAR(LS_Inv_Dates)=YEAR(A7)*(MONTH(LS_ Inv_Dates)=MONTH(A7))*LS_I
nv_Values)



=SUMPRODUCT((YEAR(LS_Inv_Dates)=YEAR(A7)*(MONTH(LS _Inv_Dates)=MONTH(A7))*LS_
I
nv_Values)



--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Trevor Shuttleworth" wrote in message
...
Don

thanks for your swift response. I had seen some of your replies to

similar
questions in the Google archives so I was trying similar lines.

At the moment I have in cell C7:



=SUMPRODUCT(YEAR(LS_Inv_Dates)=YEAR(A7)*(MONTH(LS_ Inv_Dates)=MONTH(A7))*LS_I
nv_Values)

where LS_Inv_Dates is ='Solutions'!$D3:$D2000
and LS_Inv_Values is ='Solutions'!$F3:$F2000

Cell A7 on the Summary sheet has 01/04/03 displayed as April 2003.

In F3 on the Solutions sheet, I have 15/04/2003 and a value in F3.

Unfortunately, this results in a value of 0

Any further thoughts ? I'm not sure where I'm going wrong

Thanks

Trevor

"Don Guillett" wrote in message
...
this should help.

=sumproduct((year(daterng=year(a1))*(month(daterng =month(a1))*rngtosum)

--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Trevor Shuttleworth" wrote in message
...
I'd be grateful for your assistance please. I think I should know

how
to
do
this, but I don't. Hopefully you can save me a lot of time.

I have a column (A) on one sheet, "Summary", which contains dates,

April
2003, May 2003 and so on. The cells actually contain 01/04/03,

01/05/03,
etc. (UK date formats)

On another sheet, "Solutions", there is a column of Invoice Dates

(D)
and
a
column of Invoice Values (F).

In column C on the Summary sheet, I want to subtotal the Invoice

Values
on
the Solutions sheet where the Invoice month and year match the month

and
year in column A on the Summary sheet.

I think I should be using SumProduct or an array entered formula but

I
can't
quite get my head round it.

I appreciate your help, thanks

Trevor