+ Reply to Thread
Results 1 to 16 of 16

Countif not taking entire cell into account.

  1. #1
    Registered User
    Join Date
    04-10-2014
    Location
    Tallahassee, FL
    MS-Off Ver
    Excel 2010
    Posts
    98

    Countif not taking entire cell into account.

    I have a VERY long list of data, but as an example:
    Please Login or Register  to view this content.
    Countif is treating all of these as identical, so I am getting a count of 1953 records total that look like the above, but are being treated by Countif as identical enough to count.

    Is there a degree of accuracy in Countif where it only identifies up to a certain number of characters? If so, how else can I find if a record is located in a different grouping?
    Last edited by Phixer; 05-27-2014 at 01:27 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Countif not taking entire cell into account.

    =sumproduct(--($a$1:$a$34=a1))
    Entia non sunt multiplicanda sine necessitate

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

    Re: Countif not taking entire cell into account.

    Hi,

    COUNTIF has the (sometimes useful, sometimes not) built-in feature that it converts data to numericals where possible.

    Use SUMPRODUCT, which can differentiate between the two data types:

    =SUMPRODUCT(0+(A1:A34=A1))

    Regards
    Click * below if this answer helped

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

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Countif not taking entire cell into account.

    It seems like these numbers are too big for formula to evaluate them. What I did is I used another column and part of the string with formula:

    =RIGHT(A2,17)


    and then I used formula =COUNTIF($B$2:B2,B2) to evaluate.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    Registered User
    Join Date
    04-10-2014
    Location
    Tallahassee, FL
    MS-Off Ver
    Excel 2010
    Posts
    98

    Re: Countif not taking entire cell into account.

    These are all text fields. I am looking for non-unique values in the list.

    The problem is that the first 16 digits are not the same in all the fields, it is just that in that example of the 1953 records pegged identical, none of them were beyond that number of digits.

    Looks like I will have to write some VB code to solve this. Thanks.

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

    Re: Countif not taking entire cell into account.

    Quote Originally Posted by Phixer View Post
    These are all text fields. I am looking for non-unique values in the list.

    The problem is that the first 16 digits are not the same in all the fields, it is just that in that example of the 1953 records pegged identical, none of them were beyond that number of digits.

    Looks like I will have to write some VB code to solve this. Thanks.
    ?? Did you see/try the solutions posted by me and shg?

    Regards

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Countif not taking entire cell into account.

    a
    b
    c
    1
    60910708130400000010077738000306032040199924201059330253370
    1
    b14: =sumproduct(--($a$1:$a$34=a14))
    2
    60910708130400000010077738000306033130199913994920285764270
    1
    3
    60910708130400000010077738000306032040199913420043207000670
    2
    4
    60910708130400000010077738000306032040199913420043207000670
    2
    5
    60910708130400000010077738000306030200099913420071042700770
    11
    6
    60910708130400000010077738000306030200099913420071042700770
    11
    7
    60910708130400000010077738000306030200099913420071042700770
    11
    8
    60910708130400000010077738000306030200099913420071042700770
    11
    9
    60910708130400000010077738000306030200099913420071042700770
    11
    10
    60910708130400000010077738000306030200099913420071042700770
    11
    11
    60910708130400000010077738000306033130199913290020078209770
    2
    12
    60910708130400000010077738000306033130199913420071042700770
    10
    13
    60910708130400000010077738000306033130199913420071042700770
    10
    14
    60910708130400000010077738000306030200099913420071042700770
    11
    15
    60910708130400000010077738000306030200099913420071042700770
    11
    16
    60910708130400000010077738000306030200099913420071042700770
    11
    17
    60910708130400000010077738000306030200099913420071042700770
    11
    18
    60910708130400000010077738000306030200099913420071042700770
    11
    19
    60910708130400000010077738000306033130199913420071042700770
    10
    20
    60910708130400000010077738000306033130199913420071042700770
    10
    21
    60910708130400000010077738000306033130199913420071042700770
    10
    22
    60910708130400000010077738000306033130199913420071042700770
    10
    23
    60910708130400000010077738000306033130199924204520189706870
    1
    24
    60910708130400000010528138000306032040199944200023033440070
    1
    25
    60910708130400000010077738000306033130199913420071042700770
    10
    26
    60910708130400000010077738000306033130199913420071042700770
    10
    27
    60910708130400000010077738000306030200099913994959308058170
    4
    28
    60910708130400000010077738000306030200099913994959308058170
    4
    29
    60910708130400000010077738000306032040199924201020069955470
    1
    30
    60910708130400000010077738000306030200099913994959308058170
    4
    31
    60910708130400000010077738000306030200099913994959308058170
    4
    32
    60910708130400000010077738000306033130199913420071042700770
    10
    33
    60910708130400000010077738000306033130199913420071042700770
    10
    34
    60910708130400000010077738000306033130199913290020078209770
    2

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Countif not taking entire cell into account.

    Interested in this for a variety of reasons... How can you copy & paste these long strings as text??
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Countif not taking entire cell into account.

    Format the cells as text beforehand, paste with destination formatting.

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

    Re: Countif not taking entire cell into account.

    Quote Originally Posted by Glenn Kennedy View Post
    Interested in this for a variety of reasons... How can you copy & paste these long strings as text??
    Format your receiving cells as text first. Then make sure you use "Match Destination Formatting" when pasting.

    Regards

  11. #11
    Registered User
    Join Date
    04-10-2014
    Location
    Tallahassee, FL
    MS-Off Ver
    Excel 2010
    Posts
    98

    Re: Countif not taking entire cell into account.

    Quote Originally Posted by XOR LX View Post
    ?? Did you see/try the solutions posted by me and shg?
    The sheet is very large, so it took a while, but all the results for every formula is zero, so... no, it didn't work. Thanks, though.

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Countif not taking entire cell into account.

    You could post a portion of the actual workbook, and someone can add the formula ...

  13. #13
    Registered User
    Join Date
    04-10-2014
    Location
    Tallahassee, FL
    MS-Off Ver
    Excel 2010
    Posts
    98

    Re: Countif not taking entire cell into account.

    We are talking hundreds of thousands of cells. The part I posted was a small part.

    Those cells are created by combining 8 other cells together into one long text string so I can check for identical values. The calculations take a considerable amount of time with each change.

    I will write some VB code to loop through all combinations and report the row numbers of duplicates. When I complete, I will see about posting the code here. Unless I get prioritized on something else, which now sounds like the case. I will see if I can come back to this.

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Countif not taking entire cell into account.

    I'm still not sure what SUMPRODUCT is actually telling me. It ISN'T telling me the number of unique values in the list (in the example above, there are 10). There are four 2's in the example posted by shg. However, these four are made up of two unique values, each repeated once.

    The number of unique values is given by:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Countif not taking entire cell into account.

    ... and FINALLY... this will return the identity of the unique values (Range in A1:A35, this equation in B2, B1 must be blank and enter as an array).

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I haven't a bloody clue HOW it works, but it does.

  16. #16
    Registered User
    Join Date
    04-10-2014
    Location
    Tallahassee, FL
    MS-Off Ver
    Excel 2010
    Posts
    98

    Re: Countif not taking entire cell into account.

    I hope this helps someone. I ended up rewriting what generated all the data to compare it while it was being generated.

    All 512393 rows of it.



    It takes a while.

+ 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. Countif Formula taking into account start dates
    By Revolution in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-15-2013, 12:17 PM
  2. Taking into account lead times ...
    By Turvy86 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-30-2009, 02:25 PM
  3. Paste without taking into account the hidden rows
    By chibouki in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-03-2008, 07:32 AM
  4. Taking in account additional rows
    By JB12 in forum Excel General
    Replies: 3
    Last Post: 12-27-2005, 02:10 PM
  5. [SOLVED] How to calculate a person's age taking into account their birthda.
    By CPD174 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-06-2005, 12:05 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