+ Reply to Thread
Results 1 to 2 of 2

Count IF Column A CONTAINS value X AND Column B CONTAINS value y??

Hybrid View

  1. #1
    Registered User
    Join Date
    08-17-2012
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    1

    Count IF Column A CONTAINS value X AND Column B CONTAINS value y??

    Hi All,

    I am trying to write a formula that counts cells in column B that CONTAIN a value y IF the cells in column A CONTAIN a value X where X and Y are strings of letters. I capitalized CONTAINS because i have writen the following formula that works when the cells EQUAL X and Y but not when they contain:

    =SUMPRODUCT(--(A1:A100="X"),--(B1:B100="Y"))


    Any ideas on how to get this to work would be greatly appreciated!

    Thanks
    Keith

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,421

    Re: Count IF Column A CONTAINS value X AND Column B CONTAINS value y??

    You can do it like this:

    Formula: copy to clipboard
    =SUMPRODUCT(--(ISNUMBER(SEARCH("x",A1:A100),--(ISNUMBER(SEARCH("y",B1:B100))


    SEARCH is not case sensitive, but if that is important to you then use FIND instead:

    Formula: copy to clipboard
    =SUMPRODUCT(--(ISNUMBER(FIND("X",A1:A100),--(ISNUMBER(FIND("Y",B1:B100))


    Obviously, "x" and "y" could be strings of letters.

    Hope this helps.

    Pete

+ 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