+ Reply to Thread
Results 1 to 9 of 9

COUNTIFS multiple AND OR criteria- please help!

  1. #1
    Registered User
    Join Date
    05-11-2016
    Location
    london
    MS-Off Ver
    2011
    Posts
    7

    Question COUNTIFS multiple AND OR criteria- please help!

    Hi,

    Need some help with a formula..

    I am trying to COUNTIF Cells in Column RawDataA:A Contain text in CellA3 AND Cells in Column RawDataB:B contain text in cells A4 OR A5 OR A6 OR A7.

    I have this formula currently but it is returning 0 for everything which is not correct.

    =SUM(COUNTIFS(Raw_Data!$A:$A, {"*"&A3&"*"},Raw_Data!$B:$B,{"*"&Themes!A4&"*","*"&Themes!A5&"*","*"&Themes!A6&"*","*"&Themes!A7&"*"}))

    Any help appreciated!

    Thanks.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: COUNTIFS multiple AND OR criteria- please help!

    Try it like this...

    =SUMPRODUCT(COUNTIFS(Raw_Data!$A:$A,"*"&A3&"*",Raw_Data!$B:$B,"*"&Themes!A4:A7&"*"))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    05-11-2016
    Location
    london
    MS-Off Ver
    2011
    Posts
    7

    Re: COUNTIFS multiple AND OR criteria- please help!

    Thanks Tony but it's still returning zeros unfortunately! Maybe there is a disconnect somewhere else in the text if that should work, I will have a deeper look.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: COUNTIFS multiple AND OR criteria- please help!

    It works for me but of course I don't have your specific data.

    Can you post a SMALL sample file and show us what result you expect?

    A SMALL file will have about 20 rows worth of data and be about 10-15kbs in size.

  5. #5
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: COUNTIFS multiple AND OR criteria- please help!

    The original formula should work.

    The obvious reasons that I can think of why it wouldn't work are either stray spaces in the criteria cells, or real dates in raw data and text dates in the criteria.

    For example, Countif will not find "July" as a text string in a real date formatted as 19 July 2016.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: COUNTIFS multiple AND OR criteria- please help!

    =SUM(COUNTIFS(Raw_Data!$A:$A, {"*"&A3&"*"},Raw_Data!$B:$B,{"*"&Themes!A4&"*","*"&Themes!A5&"*","*"&Themes!A6&"*","*"&Themes!A7&"*"}))
    Quote Originally Posted by jason.b75 View Post
    The original formula should work.
    Array constants can't contain cell/range references.

  7. #7
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: COUNTIFS multiple AND OR criteria- please help!

    Quote Originally Posted by Tony Valko View Post
    Array constants can't contain cell/range references.
    Please ignore my previous contribution of misinformation!

    Early morning brainfart.

  8. #8
    Registered User
    Join Date
    05-11-2016
    Location
    london
    MS-Off Ver
    2011
    Posts
    7

    Re: COUNTIFS multiple AND OR criteria- please help!

    Thanks for confirming, I have tried with a sample data set and Tony's formula is working great so I will have to dig into the data and look for spaces etc.

    Thanks for all your help!

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: COUNTIFS multiple AND OR criteria- please help!

    You're welcome. Thanks for the feedback!

+ 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. Countifs with multiple criteria in single criteria range
    By MCP313 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-01-2016, 03:51 AM
  2. [SOLVED] COUNTIFS with multiple criteria in the same criteria range
    By Faridwahidi in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-23-2015, 01:04 PM
  3. [SOLVED] countifs statement with multiple criteria for multiple criteria ranges
    By mcdermott2 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-07-2015, 11:48 AM
  4. [SOLVED] Countifs multiple criteria, and 1 criteria Less than & Greater than
    By david gonzalez in forum Excel General
    Replies: 4
    Last Post: 06-30-2014, 10:33 PM
  5. [SOLVED] Countifs with multiple criteria and one criteria has a list of names
    By Beefy1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-30-2014, 05:25 PM
  6. [SOLVED] Countifs with multiple criteria
    By yenaled in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 01-24-2013, 10:07 AM
  7. Replies: 0
    Last Post: 07-27-2011, 01:00 AM

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