View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
RagDyeR RagDyeR is offline
external usenet poster
 
Posts: 3,572
Default Manipulating subsets of large datasets

If I understand what you're looking for, the easiest way to return data
that's bracketed between dates is to assign 2 cells to contain those
limitation dates, whether those restrictions be days, months, or years.

For example, with A1 containing the "start" date, and A2 the "ending" date,
and item colors listed in Column C, and item weights in Column D, and the
dates these items were "used" listed in Column B ... you're looking for a
count of all red items of less then 10 pounds that were used between June 1,
2006 and August 15, 2007:

A1 = 6/1/06
A2 = 8/15/07 (my date formats)

=Sumproduct((B2:B1000=A1)*(B2:B1000<=A2)*(C2:C100 0="Red")*(D2:D1000<10))

Needless to say, the criteria of "Red" and 10 could *also* be referenced in
other cells, to eliminate the need to revise the formula itself.

Just to add *another variable*, say you *only* wanted to count the red items
of less then 10 lbs. that were used in the month of February, between 2005
and 2007, you might try something like this:

A1 = 2/1/05
A2 = 3/1/07 (so you don't have to remember if it was a leap year or not)

=SUMPRODUCT((B2:B1000=A1)*(B2:B1000<=A2)*(MONTH(B 2:B1000)=2)*(C2:C1000="Red")*(D2:D1000<10))

And of course, the month number 2 could have been assigned to a cell.


--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"Astrofin" wrote in message
...
Ragdyer:
Sumproduct is just what I was looking for. What an elegant solution! Thank
you.

MH:
The data is exported from a sql database. The database is currently under
development and doesn't provide the calculation and graphing functions that
I
require. Yet!

I should probably start a new thread for this, but I'm still stumped by the
date issue. Dates are stored as a dd/mm/yyyy date string. How can I filter
out dates within a particular month for use within calculations, without
constructing complicated if and if< functions. Not only does this become
unwieldy, but is difficult when data covers multiple years.

Thank you for your help and suggestions.