+ Reply to Thread
Results 1 to 7 of 7

Count a Matching criteria to a date range

Hybrid View

scaffdog845 Count a Matching criteria to... 09-10-2010, 03:19 PM
NBVC Re: Count a Matching criteria... 09-10-2010, 03:28 PM
scaffdog845 Re: Count a Matching criteria... 09-14-2010, 09:18 AM
NBVC Re: Count a Matching criteria... 09-14-2010, 09:57 AM
scaffdog845 Re: Count a Matching criteria... 09-14-2010, 12:37 PM
NBVC Re: Count a Matching criteria... 09-14-2010, 12:40 PM
scaffdog845 Re: Count a Matching criteria... 09-16-2010, 02:25 PM
  1. #1
    Valued Forum Contributor scaffdog845's Avatar
    Join Date
    02-01-2008
    Location
    Aston, PA. USA.
    MS-Off Ver
    Microsoft 365
    Posts
    375

    Count a Matching criteria to a date range

    Afternoon all,

    I'm trying to work out how to add a date range criteria to this SUMPRODUCT formula
    =SUMPRODUCT(('Planning Data'!$A$1:$A$10000="1A")*('Planning Data'!$E1:$E10000={"AADP","AM","EAA","PAA","RS","RSNR","S","SAM","SAMT","SAO","SAT","SOR","WKS"}))
    As is, this formula returns the result of how many work orders within a certain area are planned based on statuses. I'd like to be able to add another criteria to show the age of these planned work orders.

    I was looking at less than 30 days, 31 - 90 days and plus 90 days. A different formula for each is fine.

    Thanks for the help all!
    Attached Files Attached Files
    Last edited by scaffdog845; 09-14-2010 at 12:39 PM. Reason: SOLVED
    Click here to read the Forum Rules
    Whatever it is in life you decide to go after, go after with great ferocity.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Count a Matching criteria to a date range

    Try:

    =SUMPRODUCT(('Planning Data'!$A$2:$A$10000="1A")*('Planning Data'!$E2:$E10000={"AADP","AM","EAA","PAA","RS","RSNR","S","SAM","SAMT","SAO","SAT","SOR","WKS"})*('Planning Data'!$J$2:$J$10000<=TODAY()+30))
    Notice starting at row 2 since J1 is text and that would cause error.


    similarly:

    =SUMPRODUCT(('Planning Data'!$A$2:$A$10000="1A")*('Planning Data'!$E2:$E10000={"AADP","AM","EAA","PAA","RS","RSNR","S","SAM","SAMT","SAO","SAT","SOR","WKS"})*('Planning Data'!$J$2:$J$10000>=TODAY()+31)*('Planning Data'!$J$2:$J$10000<=TODAY()+90))
    etc
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Valued Forum Contributor scaffdog845's Avatar
    Join Date
    02-01-2008
    Location
    Aston, PA. USA.
    MS-Off Ver
    Microsoft 365
    Posts
    375

    Question Re: Count a Matching criteria to a date range

    NBVC,

    Thanks for the reply. I worked with your suggestions a bit yesterday and could not get them to work correctly. I've re-attached a workbook where I've used your formulas. H2:F11 have the formulae and I2:K11 have what the correct results should be.

    Please note that the criteria string inside the SUMPRODUCT function was changed from
    "AADP","AM","EAA","PAA","RS","RSNR","S","SAM","SAMT","SAO","SAT","SOR","WKS"
    to
    "AB","AE","AO","AWE","AWI","AWT","BLC","CAN","DFRD","FC","FCAA","FCHP","RP"
    Attached Files Attached Files

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Count a Matching criteria to a date range

    Ok, for the Under 30 days.. I didn't know you probably wanted from today to 30 days in the future...

    I would amend the formula to:

    =SUMPRODUCT(('Planning Data'!$A$2:$A$10000="1A")*('Planning Data'!$E2:$E10000={"AB","AE","AO","AWE","AWI","AWT","BLC","CAN","DFRD","FC","FCAA","FCHP","RP"})*('Planning Data'!$J$2:$J$10000>=TODAY())*('Planning Data'!$J$2:$J$10000<=TODAY()+30))
    But I get 16 and have filtered the main database based on your conditions and drilled down to the 16.

    How do you get 0?
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor scaffdog845's Avatar
    Join Date
    02-01-2008
    Location
    Aston, PA. USA.
    MS-Off Ver
    Microsoft 365
    Posts
    375

    Re: Count a Matching criteria to a date range

    NBVC

    Thanks again for the help. your last comment
    I didn't know you probably wanted from today to 30 days in the future...
    and the fact that you drilled down within the data and had a different result caused me to look a little harder at your original post. I never specified which column to use as the date criteria and you went with J:J which was the basic finsih date. I was looking at what age a WO was based on the created on date in K:K. I went back and tweaked the original spreadsheet using the correct column references and everything appears fine now.

    For anyone who may have been looking at this post the final formulas are as follows. For WO's created from today to 30 days in the past
    =SUMPRODUCT(('Planning Data'!$A$2:$A$10000="1A")*('Planning Data'!$E2:$E10000={"AB","AE","AO","AWE","AWI","AWT","BLC","CAN","DFRD","RP"})*('Planning Data'!$K$2:$K$10000<=TODAY())*('Planning Data'!$K$2:$K$10000>=TODAY()-30))
    for WO's created from 31 to 90 days ago
    =SUMPRODUCT(('Planning Data'!$A$2:$A$10000="1A")*('Planning Data'!$E2:$E10000={"AB","AE","AO","AWE","AWI","AWT","BLC","CAN","DFRD","FC","FCAA","FCHP","RP"})*('Planning Data'!$K$2:$K$10000>=TODAY()-31)*('Planning Data'!$K$2:$K$10000<=TODAY()-90))
    and for WO's created 91 days ago or more
    =SUMPRODUCT(('Planning Data'!$A$2:$A$10000="1A")*('Planning Data'!$E2:$E10000={"AB","AE","AO","AWE","AWI","AWT","BLC","CAN","DFRD","FC","FCAA","FCHP","RP"})*('Planning Data'!$K$2:$K$10000>=TODAY()-31)*('Planning Data'!$K$2:$K$10000<=TODAY()-90))

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Count a Matching criteria to a date range

    I should have also stated that assumption...
    Last edited by NBVC; 09-14-2010 at 01:14 PM.

  7. #7
    Valued Forum Contributor scaffdog845's Avatar
    Join Date
    02-01-2008
    Location
    Aston, PA. USA.
    MS-Off Ver
    Microsoft 365
    Posts
    375

    Re: Count a Matching criteria to a date range

    It's all good and the help is truely appreciated! Have a great day!

+ 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