+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    09-15-2009
    Location
    Fort Lauderdale, FL
    MS-Off Ver
    Excel 2007
    Posts
    4

    Question Need Validation type drop-down wildcard in Sumproduct

    I have a worksheet report that counts question answers filtered by facility, date range and case manager. I use Data Validation "List" criteria to make the in-cell drop-down lists for the criteria of the variable values. For most of them the selected value works fine, but for the case manager drop-down I need a value in the list, other than the peoples names, to represent "All" or be a wildcard and include all values in the selection.

    Here is the formula:
    Code:
    =SUMPRODUCT(--(WTP!$P$2:$P$420='WTP Report'!F$4),--(WTP!$I$2:$I$420='WTP Report'!$I$1),--(WTP!$M$2:$M$420='WTP Report'!$M$2),--(OFFSET(WTP!$A$2:$A$420,0,MATCH($Q6,WTP!$1:$1,FALSE)-1)=E$5)*1)
    Here is the piece of concern from the above formula:
    Code:
    (WTP!$M$2:$M$420='WTP Report'!$M$2)

    WTP Report!$M$2 is where the drop-down list is located. It gets it's list from a range containing a bunch of peoples names. Say, $AA$2:$AA$32
    WTP!$M$2:$M$420 is where the names from the records in the database are stored.

    I'd like to be able to stick some value like % or * or "%*%" in the list of names that would act like a "All" wildcard. I tried those, they don't work. ;-)

    Thanks in advance.
    (Please don't just inform me that I can't use a wildcard in a sumproduct, I'm looking for a solution to a problem.)
    Last edited by megnin; 10-05-2009 at 05:37 PM.

  2. #2
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,163

    Re: Need Validation type drop-down wildcard in Sumproduct

    Hard to make sure it is right with no sheet to test, but try replacing that part with:

    --ISNUMBER(MATCH(WTP!$M$2:$M$420,IF('WTP Report'!$M$2="*",WTP!$AA$2:$AA$32,'WTP Report'!$M$2),0))

    Where you can place a "*" range WTP!$AA$2:$AA$32 so that it is included in drop down..
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Forum Guru
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2003
    Posts
    2,286

    Re: Need Validation type drop-down wildcard in Sumproduct

    How about:
    --(WTP!$M$2:$M$420='WTP Report'!$M$2)
    Becomes
    ((WTP!$M$2:$M$420='WTP Report'!$M$2)+1*('WTP Report'!$M$2="all"))
    ?

    Like NBVC, tested out of context, but seemed to work. Will return peculiar results if M contains "all" as an entry somewhere

    CC
    Last edited by Cheeky Charlie; 10-05-2009 at 04:55 PM.

  4. #4
    Registered User
    Join Date
    09-15-2009
    Location
    Fort Lauderdale, FL
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Need Validation type drop-down wildcard in Sumproduct

    Here is the one I used:

    =SUMPRODUCT(--(WTP!$P$2:$P$420='WTP Report'!F$4),--(WTP!$I$2:$I$420='WTP Report'!$I$1),--(('WTP Report'!$M$2="All)+(WTP!$M$2:$M$420='WTP Report'!$M$2)>0),--(OFFSET(WTP!$A$2:$A$420,0,MATCH($Q6,WTP!$1:$1,FALSE)-1)=E$5)*1)

    I then just added "All" to the top of the list of names.

    Thank you. Several of those techniques looked useful.

  5. #5
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,163

    Re: Need Validation type drop-down wildcard in Sumproduct

    Quote Originally Posted by megnin View Post
    Here is the one I used:

    =SUMPRODUCT(--(WTP!$P$2:$P$420='WTP Report'!F$4),--(WTP!$I$2:$I$420='WTP Report'!$I$1),--(('WTP Report'!$M$2="All)+(WTP!$M$2:$M$420='WTP Report'!$M$2)>0),--(OFFSET(WTP!$A$2:$A$420,0,MATCH($Q6,WTP!$1:$1,FALSE)-1)=E$5)*1)

    I then just added "All" to the top of the list of names.

    Thank you. Several of those techniques looked useful.
    Gotten from here:

    http://www.mrexcel.com/forum/showthread.php?t=420494

    Which is a cross-post... breaking another of our rules...
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0