View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sam via OfficeKB.com Sam via OfficeKB.com is offline
external usenet poster
 
Posts: 247
Default SUMPRODUCT - Exclude LAST Row of Matched Criteria (Month & Year)

Hi Bob,

Thank you very much for your reply.

Your interpretation is close.

SUMPRODUCT version) returns 3, i.e. it ignores row 12. This is what you
wanted isn't it?


In an attempt to be brief - I omitted:
The dates in B1:B20 & C1:C20 are in ascending order.
For example; I require the exclusion of the row with the LAST instance of the
month June, whether or not a specific number is in that row. The row
EXCLUSION should be based soley on the LAST instance of the particular Month
in question per cells B26 & C26 searching B1:B20 & C1:C20 "Results" range,
and NOT based on excluding the last row with the Numeric Value that cell F23
holds (eg; 11).

I hope this helps.

Cheers,
Sam

Bob Phillips wrote:
Sam,


You just convert it wholesale to SUMPRODUCT.


=SUMPRODUCT(--(OFFSET(Results,0,3,MAX(INDEX((MONTH(OFFSET(Result s,0,1,,1))=MONTH($B26))*
(YEAR(OFFSET(Results,0,2,,1))=YEAR($C26))*(ROW(Re sults)),0)-MIN(ROW(Results))),5)=$F$23))


I just developed it as an array formula (as I originally included an IF),
but they work the same.


My testing works as I understand the spec, I created a Results range of
A1:H20, filled D1:H20 with random values, filled B1:B20 and C1:C20 with
dates,and F23 with 11. I put 01/06/2006 in B26 and C26. In my data, June was
in rows 9, 10 and 12, and row 9 had a single 11, row 10 and two 11s, and row
12 had 1. Domenic's formula returned 4 in my test, and mine (and the
SUMPRODUCT version) returns 3, i.e. it ignores row 12. This is what you
wanted isn't it?


But what do you mean by '...It appears to be incrementing the cell value row
by row ...'?


--
Message posted via http://www.officekb.com