+ Reply to Thread
Results 1 to 8 of 8

Array Formula 4 Criteria, One of them Multiple Option

  1. #1
    Registered User
    Join Date
    01-12-2013
    Location
    Alberta, Canada
    MS-Off Ver
    Excel 2007
    Posts
    18

    Array Formula 4 Criteria, One of them Multiple Option

    I am pulling a report together from a data worksheet.

    I need to pull with the following 4 criteria.
    - program element
    - after a certain start date
    - before a certain end date
    - a contract number within a range specified


    If I pull from only one cell representing the contract number I have no problems. But when I try to pull from a range, I get an error.

    Here is my formula
    =SUMPRODUCT(--('PPV Data'!$I$8:$I$21111>=$AD$7),--('PPV Data'!$I$8:$I$21111<=$AD$8),--('PPV Data'!$H$8:$H$21111="JP"),--('PPV Data'!$Q$8:$Q$21111=AA8:AA41))

    PPV Data sheet cells
    "I" are dates
    "H" is the program element
    "Q" is the contract number

    so in my report worksheet I have cells to enter the contract numbers I want included, this could range from 1 contract up to 33 contracts. I want the report to tell me, from the contract numbers entered in cells AA8 through AA41, There are X number of cells with the JP program element between the two dates entered.

    If I use only a single contract number and reference only a single cell in this part of the formula ---('PPV Data'!$Q$8:$Q$21111=AA8:AA41) I have no problem.

    Ideas?

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Array Formula 4 Criteria, One of them Multiple Option

    Can you upload example workbook?

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Array Formula 4 Criteria, One of them Multiple Option

    Try changing the last condition like this

    =SUMPRODUCT(--('PPV Data'!$I$8:$I$21111>=$AD$7),--('PPV Data'!$I$8:$I$21111<=$AD$8),--('PPV Data'!$H$8:$H$21111="JP"),--ISNUMBER(MATCH('PPV Data'!$Q$8:$Q$21111,AA8:AA41,0)))

    or use COUNTIFS like this

    =SUMPRODUCT(COUNTIFS('PPV Data'!$I$8:$I$21111,">="&$AD$7,'PPV Data'!$I$8:$I$21111,"<="&$AD$8,'PPV Data'!$H$8:$H$21111,"JP",'PPV Data'!$Q$8:$Q$21111,AA8:AA41))
    Audere est facere

  4. #4
    Forum Contributor
    Join Date
    12-23-2003
    Posts
    179

    Re: Array Formula 4 Criteria, One of them Multiple Option

    Quote Originally Posted by excelmabel2013 View Post
    I am pulling a report together from a data worksheet.

    I need to pull with the following 4 criteria.
    - program element
    - after a certain start date
    - before a certain end date
    - a contract number within a range specified


    If I pull from only one cell representing the contract number I have no problems. But when I try to pull from a range, I get an error.

    Here is my formula
    =SUMPRODUCT(--('PPV Data'!$I$8:$I$21111>=$AD$7),--('PPV Data'!$I$8:$I$21111<=$AD$8),--('PPV Data'!$H$8:$H$21111="JP"),--('PPV Data'!$Q$8:$Q$21111=AA8:AA41))

    PPV Data sheet cells
    "I" are dates
    "H" is the program element
    "Q" is the contract number

    so in my report worksheet I have cells to enter the contract numbers I want included, this could range from 1 contract up to 33 contracts. I want the report to tell me, from the contract numbers entered in cells AA8 through AA41, There are X number of cells with the JP program element between the two dates entered.

    If I use only a single contract number and reference only a single cell in this part of the formula ---('PPV Data'!$Q$8:$Q$21111=AA8:AA41) I have no problem.

    Ideas?
    On all versions...
    Please Login or Register  to view this content.
    Another option is a SumProduct formula with CountIfs, as posted in another reply.

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Array Formula 4 Criteria, One of them Multiple Option

    Aladin Akyurek,
    please don't quote whole posts -- it's just clutter.
    If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding.

  6. #6
    Registered User
    Join Date
    01-12-2013
    Location
    Alberta, Canada
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Array Formula 4 Criteria, One of them Multiple Option

    Thanks for the Ideas. They don't seem to calculate what I need.

    Here is a sample worksheet. I put everything on one sheet for the sample. In my workbook it's on two different tabs, but this will work well to play with.
    Attached Files Attached Files

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Array Formula 4 Criteria, One of them Multiple Option

    You have some cell references incorrect in that formula, and a few syntactical errors - given that 50 row sample try either

    =SUMPRODUCT(COUNTIFS($B$4:$B$50,">="&$I$6,$B$4:$B$50,"<="&$I$7,$A$4:$A$50,"JP",$C$4:$C$50,E7:E20))

    or

    =SUMPRODUCT(--($B$4:$B$50>=$I$6),--($B$4:$B$50<=$I$7),--($A$4:$A$50="JP"),--ISNUMBER(MATCH($C$4:$C$50,E7:E20,0)))

  8. #8
    Registered User
    Join Date
    01-12-2013
    Location
    Alberta, Canada
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Array Formula 4 Criteria, One of them Multiple Option

    Wonderful! You guys just made my day! Thanks a Bunch!

+ 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