+ Reply to Thread
Results 1 to 3 of 3

Thread: COUNTIF one of three choices

  1. #1
    Registered User
    Join Date
    12-29-2009
    Location
    Lilburn, Ga.
    MS-Off Ver
    Excel 2003
    Posts
    2

    COUNTIF one of three choices

    (Excel 2003) Using countif with a range, the formula must count the number of times each cell in the range contains either of three choices. There will be times when someone may input all three of the choices in a cell, and I need it to count only "one" of the three. If a cell within the range contains one of the three, the count of that cell = "1". If a cell within the range contains all three of the three choices, the count for that cell is still = "1". The following countif statement is the best I have come up with so far, but unfortunately it doesn't count only one of the three, but ends up with the count of "3" if all three choices are listed in the cell:

    =SUM(COUNTIF(1C:3C,{"*OJI*","*light*","*duty*"}))

    cell 1C = OJI, on light duty
    cell 2C = light duty
    cell 3C = OJI

    The formula above will return a value of "6", I need it to count "3", "1" for each cell.

  2. #2
    Forum Guru Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    2003, 2007 and 2010
    Posts
    1,207

    Re: COUNTIF one of three choices

    Hi,

    Here's one way:

    =SUMPRODUCT(--(ISNUMBER(SEARCH("oji",C1:C4))+ISNUMBER(SEARCH("light",C1:C4))+ISNUMBER(SEARCH("duty",C1:C4))>0))
    Hope that helps,

    Colin

    RAD Excel Blog

    Other tutorials:
    Array Formulas | Deleting Rows with VBA

  3. #3
    Extremely Helpful member
    Join Date
    12-23-2006
    Location
    Belgium
    MS-Off Ver
    XL2003
    Posts
    6,127

    Re: COUNTIF one of three choices

    Your post does not comply with Rule 5 of our Forum RULES. We have Seven question forums: Miscellaneous, General, Programming, Worksheet Functions, Charting, Excel 2007 Help and New Users. Please choose the appropriate forum, and post your question in ONLY one forum.

    As you are quite new, I will do it for you this time. Please have a look at forum rules
    Quoting entire posts clutters the forum and makes threads hard to read !

    If you are pleased with a member's answer then use the Star icon to rate it

    Click here to see forum rules

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