+ Reply to Thread
Results 1 to 14 of 14

COUNTIF() not working as expected?

  1. #1
    Registered User
    Join Date
    02-27-2015
    Location
    Jacksonville
    MS-Off Ver
    2015
    Posts
    3

    COUNTIF() not working as expected?

    I'm really struggling here and have racked my brain and google for this to work.... I can't get the count to work right for the next set.. please review and any help would be awesome..
    Attached Files Attached Files
    Last edited by FDibbins; 02-27-2015 at 09:15 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: COUNTIF() not working as expected?

    I think all you need here is this?
    =COUNTIF(E8:J8,P8)

    Note that the use of "=1" is unnecessary, all you need is 1 or 2 etc

    Also, I changed your title to something that actually describes your problem (Read rule 1 )
    Last edited by FDibbins; 02-27-2015 at 09:26 PM.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: COUNTIF() not working as expected?

    Actually, I think your original formula is working (but FDibbins is correct about the "=1"... just put 1)...

    I don't see any 1's in the the 3rd row, so it should show 0... or am I reading this wrong?

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: COUNTIF() not working as expected?

    edit R8, press Control+Shift+Enter and drag down

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: COUNTIF() not working as expected?

    Sandy, how will that work? The formula is actually working fine, all your suggestion does, is make it an unnecessary ARRAY formula

    The "= and " can be removed though

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: COUNTIF() not working as expected?

    But if you do that (CSE) it's working, isn't it? :-)

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: COUNTIF() not working as expected?

    Yes it is, but it is working without it too, so it's kind of redundant

    ARRAY's can become very resource-intensive and start to slow your file down (not in a simple example like this, I agree). You normally use ARRAY's when you atr using - well - array's

  8. #8
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: COUNTIF() not working as expected?

    Ups, sorry, I saw RED and without checking did CSE and drag.
    My fault :-)

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: COUNTIF() not working as expected?

    Hey, no problem, if you dont ask, you wont know. We are here to try and help (and be helped)

    And we are not always right, so - ask away all you want

  10. #10
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: COUNTIF() not working as expected?

    Hard to think about 3am

  11. #11
    Registered User
    Join Date
    02-27-2015
    Location
    Jacksonville
    MS-Off Ver
    2015
    Posts
    3

    Re: COUNTIF() not working as expected?

    thank you for the help, still not working right though. Sorry I'm really trying to get "it" but having a hard time, please read the included notes in the excel file that will help explain what each set is (I have this formula correct on another sheet).. Anyway it is just the count I can't get right...Formula test.xlsx

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: COUNTIF() not working as expected?

    My suggestion still works. I dont see how you expect to get an answer of 6 for those red cells when you only have 4 matching entries in that row?

    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    O
    P
    Q
    R
    S
    18
    Tier 1 Tier 2 Tier 3 Tier 4 Tier 5 Tier 6
    set 1
    set 2
    set 3
    Total sets
    Count to Next Set
    19
    1
    1
    1
    1
    1
    1
    1
    0
    0
    1
    6
    6
    Correct
    20
    1
    1
    1
    1
    2
    0
    1
    0
    0
    1
    4
    4
    incorrect
    21
    1
    1
    1
    1
    0
    2
    1
    0
    0
    1
    4
    4
    incorrect
    22
    2
    2
    2
    2
    2
    2
    0
    2
    0
    2
    6
    6
    correct
    23
    2
    2
    2
    2
    3
    1
    0
    2
    0
    2
    4
    4
    incorrect
    24
    2
    2
    2
    2
    1
    3
    0
    2
    0
    2
    4
    4
    incorrect
    25
    2
    2
    2
    2
    4
    0
    0
    2
    0
    2
    4
    4
    incorrect
    26
    2
    2
    2
    2
    0
    4
    0
    2
    0
    2
    4
    4
    incorrect

    Q19=COUNTIF(E19:J19,P19)

  13. #13
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: COUNTIF() not working as expected?

    Maybe Fdibbins are following the origin formula with COUNTIF which is not suitable.

    What does the "Count to Next Set" should do? what are your expected results for this column?
    Quang PT

  14. #14
    Registered User
    Join Date
    02-27-2015
    Location
    Jacksonville
    MS-Off Ver
    2015
    Posts
    3

    Re: COUNTIF() not working as expected?

    The expected results for the count to next set is for excel to count how many are needed for next set..
    Formula test.xlsx

    some how I need it to count to the next set with it understanding that tiers 1 through 4 are 1111, 2222,3333 etc... tiers 4 and 5 are 1and1,or 2and0,or 0and2, for first set, then 2and2, or 1and3, 3and1, or 4and0, or 0and4. I need it to understand all the possible combos needed for the next and then calculate how many are missing to get to the next set.. Again thanks for the help...

+ 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. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  2. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 PM

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