Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: How to add a condition to COUNTIFS formula to exclude certain numbers?
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Apr 2018
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default How to add a condition to COUNTIFS formula to exclude certain numbers?

    Hello,

    I have a COUNTIFS formula [=COUNTIFS(B2:I2,"<70")] that calculates the number of times a score is less than 70, as follows:

    Dates 3/4/2019 3/11/2019 3/18/2019 3/25/2019 4/1/2019 4/8/2019 4/15/2019 etc.
    Student1 71 68 78 92 79 96 73 etc.
    Student2 56 71 68 75 70 81 77
    Student3 79 91 89 89 94 90 92
    etc.

    How can I add a condition to the formula that allows to exclude scores that correspond to dates marked with an "X" within the "Calendar" sheet with the same organization as the above sheet, as follows:

    Dates: 3/4/2019 3/11/2019 3/18/2019 3/25/2019 4/1/2019 4/8/2019 4/15/2019 etc.
    X X X

    Thanks for any input!

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,203
    Post Thanks / Like
    Mentioned
    470 Post(s)
    Tagged
    47 Thread(s)

    Default Re: How to add a condition to COUNTIFS formula to exclude certain numbers?

    How about
    =COUNTIFS(B2:I2,"<70",Calendar!B2:I2,"<>x")
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  3. #3
    Board Regular
    Join Date
    Apr 2018
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How to add a condition to COUNTIFS formula to exclude certain numbers?

    Sweet, thanks a lot!

  4. #4
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,203
    Post Thanks / Like
    Mentioned
    470 Post(s)
    Tagged
    47 Thread(s)

    Default Re: How to add a condition to COUNTIFS formula to exclude certain numbers?

    You're welcome & thanks for the feedback
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  5. #5
    Board Regular
    Join Date
    Apr 2018
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How to add a condition to COUNTIFS formula to exclude certain numbers?

    What if each student has their own "Calendar" sheet criteria such as below:

    Dates: 3/4/2019 3/11/2019 3/18/2019 3/25/2019 4/1/2019 4/8/2019 4/15/2019 etc.
    Student1 X X X
    Student2 X X
    Student3 X X
    etc.


    Thanks a lot!

  6. #6
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,203
    Post Thanks / Like
    Mentioned
    470 Post(s)
    Tagged
    47 Thread(s)

    Default Re: How to add a condition to COUNTIFS formula to exclude certain numbers?

    How about
    =COUNTIFS(B2:I2,"<70",INDEX(Calendar!$B$2:$I$4,MATCH(A2,Calendar!$A$2:$A$5,0),0),"<>x")
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  7. #7
    Board Regular
    Join Date
    Apr 2018
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How to add a condition to COUNTIFS formula to exclude certain numbers?

    Amazing!! Thanks a lot!!

    I might have one more condition added based on the new score sheets I have received, so I'll post if I can't figure out myself

  8. #8
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,203
    Post Thanks / Like
    Mentioned
    470 Post(s)
    Tagged
    47 Thread(s)

    Default Re: How to add a condition to COUNTIFS formula to exclude certain numbers?

    You're welcome & thanks for the feedback
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  9. #9
    Board Regular
    Join Date
    Apr 2018
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How to add a condition to COUNTIFS formula to exclude certain numbers?

    I'm trying to use your formula from the "Main" Sheet, and I made adjustments as follows, but I'm getting the #VALUE ! error:

    =COUNTIFS(Scores!B2:G2,"<70",INDEX(Calendar!$B$2:$I$4,MATCH(Scores!A2,Calendar!$A$2:$A$5,0),0),"<>x")

    Am I missing anything? Thanks a lot!

    (The scores are in the "Scores" sheet)

  10. #10
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,203
    Post Thanks / Like
    Mentioned
    470 Post(s)
    Tagged
    47 Thread(s)

    Default Re: How to add a condition to COUNTIFS formula to exclude certain numbers?

    You're ranges are different sizes
    =COUNTIFS(Scores!B2:G2,"<70",INDEX(Calendar!$B$2:$I$4,MATCH(Scores!A2,Calendar!$A$2:$A$5,0),0),"<>x")
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •