+ Reply to Thread
Results 1 to 11 of 11

CountIfs when you need to count two results in the same column

  1. #1
    Registered User
    Join Date
    03-12-2014
    Location
    Ventura, CA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Question CountIfs when you need to count two results in the same column

    I am creating a Summary Chart to summarize Yes No N/A data. I am summarizing the percentage of Yes responses. Where I am having issues is getting the denominator to calculate correctly. I want the denominator to count only the Yes and No answers (not blanks or N/As). I have tried countifs(A:A,"Yes",A:A,"No"), which returns a 0. I have tried countif(A:A,and("Yes","No"), which also returns a 0. I'm sure it's a syntax error, but I can't figure out what the issue is.
    Attached Files Attached Files

  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 when you need to count two results in the same column

    I didn't download your file.

    Try it like this...

    =SUM(COUNTIF(A:A,{"Yes","No"}))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    03-12-2014
    Location
    Ventura, CA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: CountIfs when you need to count two results in the same column

    I still get a 0 when I do that. Thank you.

  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 when you need to count two results in the same column

    You have to refer to the correct column.

    I did download your file.

    For example:

    =SUM(COUNTIF(D:D,{"Yes","No"}))

    Returns 18

  5. #5
    Registered User
    Join Date
    03-12-2014
    Location
    Ventura, CA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: CountIfs when you need to count two results in the same column

    When I put that as part of my equation in field Summary Chart!B3 to get my percentage, it's telling me that there is an error.

    Here is my calculated field, as it currently stands: =IF(Data!$A:$A='Summary Chart'!$A3,(COUNTIFS(Data!$A:$A,$A3,Data!D:D,"Yes")/COUNTIFS(Data!$A:$A,'Summary Chart'!$A3,SUM(COUNTIF(Data!D:D,{"Yes","No"])))),"")

  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 when you need to count two results in the same column

    This formula returns 95%. Not sure if that's the result you expect but we can tweak it if needed.

    =SUM(COUNTIFS(Data!$A:$A,$A3,Data!D:D,{"Yes","No"}))/COUNTIF(Data!$A:$A,$A3)

  7. #7
    Registered User
    Join Date
    03-12-2014
    Location
    Ventura, CA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: CountIfs when you need to count two results in the same column

    It should return 89% (16 Yesses/18 answers). Week 1 has 19 entries, but only 18 were answered for question 1A. Since the weeks will change, that is why I have the data limiting itself to week 1 (we will be entering week 2, week 3, etc.).

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

    Re: CountIfs when you need to count two results in the same column

    I think we got it this time...

    =COUNTIFS(Data!$A:$A,$A3,Data!D:D,"Yes")/SUM(COUNTIFS(Data!$A:$A,$A3,Data!D:D,{"Yes","No"}))

    Returns 89%

  9. #9
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: CountIfs when you need to count two results in the same column

    Nevermind, there are also N/A answers..

  10. #10
    Registered User
    Join Date
    03-12-2014
    Location
    Ventura, CA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: CountIfs when you need to count two results in the same column

    There it is. Thank you so much, Tony!

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

    Re: CountIfs when you need to count two results in the same column

    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. Count results to data column
    By BradHart in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-03-2015, 12:42 PM
  2. [SOLVED] COUNTIFS formula for filtered results
    By macrorookie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-04-2014, 11:55 AM
  3. CountIFs results excluding duplicates
    By Excel_learner in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-09-2014, 10:38 AM
  4. [SOLVED] countifs between 2 dates with count of another column
    By Vivien in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 01-06-2014, 05:31 AM
  5. [SOLVED] Countifs results in 0 with Date range
    By kevindub in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-07-2013, 01:35 PM
  6. Replies: 7
    Last Post: 01-10-2012, 10:47 AM
  7. Countifs results excluding duplicates
    By jeffreybrown in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-28-2011, 12:22 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