+ Reply to Thread
Results 1 to 4 of 4

Countif with multiple variable criteria and wildcard "*"

  1. #1
    Registered User
    Join Date
    02-29-2016
    Location
    Israel
    MS-Off Ver
    2007
    Posts
    27

    Countif with multiple variable criteria and wildcard "*"

    Hello all,

    I have a table with multiple columns. One of the columns is named EQUIP and has the names of different equipment. Some of these machines have chambers where the products run. When the product runs in a machine with a chamber, it gets a suffix with the name of the chamber - for example, The machine is named HDP06 and it has a chamber so if the product runs in HDP06 - it will show as HDP06-A

    I want to create a pivot table based on all the machines over a period which the user chooses.

    The user can choose to exclude certain machines from the table with a wildcard. The users machines will be placed in a different column.

    If the user enters HDP06, I want to filter all tools that contain HDP06, this could mean HDP06-A/B/C

    I tried using the following but got an error.

    =countif(I$2:I$10&"*", [@equip])

    I$2:I$10 contains the excluded list.

    If the machine exists in the excluded list, the countif should return 1.

    I know that the problem is because of the use of the wildcard on the range but I can't think of anything else.

    Any help is appreciated.

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Countif with multiple variable criteria and wildcard "*"

    =SUMPRODUCT(--ISNUMBER(SEARCH([@equip],I$2:I$10)))

  3. #3
    Registered User
    Join Date
    02-29-2016
    Location
    Israel
    MS-Off Ver
    2007
    Posts
    27

    Re: Countif with multiple variable criteria and wildcard "*"

    tim201110, thanks for taking the time to help.

    I get a 1 for the first row in the table but after that all others are 0.

    In the criteria range, there are more than 1 machine to filter out so it should be showing more than one "1".

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,535

    Re: Countif with multiple variable criteria and wildcard "*"

    Try rearranging your Countif based formula as follows, then activate it as an array entered formula^ before you attempt to copy it to other cells:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    ^Array entered formulas are confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 07-24-2017, 02:19 AM
  2. Replies: 35
    Last Post: 01-13-2016, 02:16 AM
  3. Replies: 3
    Last Post: 04-16-2014, 10:00 AM
  4. COUNTIF for "not equal to" with multiple criteria
    By crayhons in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-11-2013, 10:33 AM
  5. [SOLVED] trying to do a "countif" with multiple ranges and multiple criteria. Countif, Sumproduct?
    By completelyhis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2013, 06:12 PM
  6. [SOLVED] Find multiple "text" criteria and return as ""Yes" in Matrix
    By bertrand82 in forum Excel General
    Replies: 11
    Last Post: 04-30-2012, 09:20 AM
  7. use variable in Workbooks("book1").Worksheets("sheet1").Range("a1"
    By Luc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-28-2005, 04:05 PM

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.6.0 RC 1