+ Reply to Thread
Results 1 to 7 of 7

Problem with Countif.

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    05-10-2011
    Location
    Central Ohio
    MS-Off Ver
    Excel 2000, and 2010
    Posts
    654

    Problem with Countif.

    I am at a loss as to why the countif formula as showning column "H" won't show the number 8 in the count list.

    The goal is to produce a list of numbers to be used as the match portion of an Index,Match formula. As shown I get a gap in the display where the number 8 should be.

    Any ideas as to what I am missing?

    Thanks

    Jim O
    Attached Files Attached Files
    Last edited by JO505; 04-23-2015 at 02:39 PM.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Problem with Countif.

    Hi.

    You mean your formula in H13 should show that value?

    But the formula in that cell is:

    =SUM(IF(G13<>1,COUNTIF(G$2:G13,G13),0),H12)

    which evaluates as:

    =SUM(IF(TRUE,COUNTIF(G$2:G13,G13),0),H12)

    i.e.:

    =SUM(IF(TRUE,2,0),H12)

    i.e.:

    =SUM(2,H12)

    i.e.:

    =SUM(2,7)

    which is 9, so I'm not sure why you were expecting this to result in 8.

    Did you perhaps not notice that the COUNTIF part would here return 2, since there are that number of occurrences of 31249 in the range G2:G13?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Valued Forum Contributor
    Join Date
    05-07-2014
    Location
    India
    MS-Off Ver
    MS Office 365
    Posts
    313

    Re: Problem with Countif.

    Hi Jim - it is happening because date in cell G13 = 31249 has repeated twice in the column G from G2 to G13 and when the formula in column H13 is calculating it found that (see below)

    H13 "=SUM(IF(G13<>1,COUNTIF(G$2:G13,G13),0),H12)"

    Then It goes into calculation

    =SUM(IF(TRUE,2,0), 7) -- > =SUM(2,7) = 9

    Please let me know if you have got the cause of your problem and might be now you have the solutions is with you. (I think so)
    Thanks
    Nisha Dhawan


    If you like my answer please click on * Add Reputation
    "If you can dream it, You can do it "

  4. #4
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,324

    Re: Problem with Countif.

    =COUNTIF($G$2:G2;">1")
    Try this formula in cell H2 en pull down the formula
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  5. #5
    Valued Forum Contributor
    Join Date
    05-07-2014
    Location
    India
    MS-Off Ver
    MS Office 365
    Posts
    313

    Re: Problem with Countif.

    And If you simple want where column G has 1, H also should return to 0 else it will keep increasing +1, then you can make the few changes in your formula and get the same.

    Below is the updated formula you can keep it in H2 and drag down.

    Formula: copy to clipboard
    =SUM(IF(G2<>1,IF(COUNTIF(G2:G$2,G2)>=1,1),0),H1)

  6. #6
    Forum Contributor
    Join Date
    05-10-2011
    Location
    Central Ohio
    MS-Off Ver
    Excel 2000, and 2010
    Posts
    654

    Re: Problem with Countif.

    Nisha Dhawan,

    Thank you. I just needed amother pair of eyes. I did have the same date entered. The first should have been April 21 and the second July 21.

    Thanks to all for their time and input.

    Jim O

  7. #7
    Valued Forum Contributor
    Join Date
    05-07-2014
    Location
    India
    MS-Off Ver
    MS Office 365
    Posts
    313

    Re: Problem with Countif.

    Jim - I am talking about the Row number 7 (G7) and Row no 13 (G13) where both the dates are same as July 21 due to that when the formula is coming and counting in in H13, it returns to count 2 for the G13 date as it has already appeared in G7. Hope this time my understanding on your problem is correct.

+ 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. [SOLVED] COUNTIF VBA problem
    By upmb851 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2014, 08:44 AM
  2. countif problem
    By arnab0711 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-25-2013, 06:30 AM
  3. COUNTIF Problem
    By Jackster in forum Excel General
    Replies: 3
    Last Post: 11-07-2006, 09:06 AM
  4. [SOLVED] Countif Problem
    By Mark W in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-21-2006, 03:40 PM
  5. Countif Problem
    By John Moore in forum Excel General
    Replies: 5
    Last Post: 11-27-2005, 03:15 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