+ Reply to Thread
Results 1 to 4 of 4

Complex calculation including extraction of month from date field

  1. #1
    Registered User
    Join Date
    01-31-2007
    Posts
    2

    Question Complex calculation including extraction of month from date field

    If anyone can help me out with this it would be greatly appreciated. I have been banging my head on this for a long time now.

    I have what amounts to a sheet that looks like this:

    'Open Date' 'Close Date' 'Product'
    January 3, 2006 January 5, 2006 ProductZ


    I have some three thousand of these rows detailing open close and product.

    What I need to do is generate some charts, and obviously first I need to figure out how to do the math. I want to have the following details.

    ProductZ
    Open Close
    January x y
    February x y
    March x y
    .
    .
    .
    December x y

    Any suggestions would be greatly appreciated.

    I know how to count each item that has January as a month, and I know how to count each item that has a specific product, but I don't know how to combine the two functions.


  2. #2
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    sumproduct((month(a$1:a$3000)=1)*($c$1:$C$3000="product Z"))

    replace the product z with the cell it is in
    the
    1 could be replaced so if january was in cell d5

    MONTH(DATEVALUE("1 "&$d5&"2006"))

    Regards

    Dav

  3. #3
    Registered User
    Join Date
    01-31-2007
    Posts
    2

    Unhappy no worky

    That doesn't appear to be working...

    here is the formula I am using:

    =SUMPRODUCT(MONTH(Sheet1!$F$2:$F$2009)=1,(Sheet1!$Q$2:$Q$2009="MCS")

    I'm using CNTRL-SHIFT-ENTER still no go...
    Last edited by arbourp; 01-31-2007 at 01:17 PM.

  4. #4
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    Its important to writew the formulas as they are shown. You do not need to make it an array

    =SUMPRODUCT((MONTH(Sheet1!$F$2:$F$2009)=1)*(Sheet1!$ Q$2:$Q$2009="MCS"))

    The two conditions return a list of true and falses, but multiplying them together with the * means you get a list of '1' or '0' .

    true*true=1
    true*false=0
    false*true=0
    false*false=0

    so it only does a sum of these values

    Regards

    Dav

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1