+ Reply to Thread
Results 1 to 11 of 11

Counting Unique Long Numbers (>15 digits)

  1. #1
    Registered User
    Join Date
    10-21-2016
    Location
    Kansas City, MO
    MS-Off Ver
    2010, 2013
    Posts
    75

    Counting Unique Long Numbers (>15 digits)

    I'm working a file with long tracking numbers, some of which are duplicated. I need to note whether each individual tracking number is a duplicate or not in a "Unique" column. This column should should list a "1" value for new tracking numbers and a "0" for repeated tracking numbers such that every tracking number lists a "1" when first listed. I've usually used IF(COUNTIF for these formulas, but COUNTIF is limited to only counting the first 15 digits as significant - many of my tracking numbers are longer. This means my file, using IF(COUNTIF says "328498283148983448323" and "328498283148983448324" are the same tracking numbers, even though they are one digit apart - if the "..323" record appears first, it lists a "1", while the "..324" record lists a "0".

    Unfortunately, I can't just delete file duplicates or use a catchall SUMPRODUCT to say "there are X# unique records in the file" - I need to specify row-by-row. Can someone please help with this? It's driving my team crazy. Sample file attached.
    Attached Files Attached Files

  2. #2
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,408

    Re: Counting Unique Long Numbers (>15 digits)

    Cell B2 formula , drag down

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

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,191

    Re: Counting Unique Long Numbers (>15 digits)

    Try

    =IF(SUMPRODUCT(--($A$2:$A2=A2))>1,0,1)
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Counting Unique Long Numbers (>15 digits)

    Please try

    =N(MATCH(A2,A$2:A2,)=ROWS(A$2:A2))

  5. #5
    Registered User
    Join Date
    10-21-2016
    Location
    Kansas City, MO
    MS-Off Ver
    2010, 2013
    Posts
    75

    Re: Counting Unique Long Numbers (>15 digits)

    Wow, thank you so much, wk9128, it works! I'm surprised a COUNTIF could still be used for the solution - what does the &"*" mean, since that's the only difference between my wrong formula and your right one?

    Thanks to JohnTopley and Bo_Ry, as well - both yours worked, too!
    Last edited by eNinjaInTraining; 10-12-2021 at 11:35 AM.

  6. #6
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,408

    Re: Counting Unique Long Numbers (>15 digits)

    @eNinjaInTraining You're Welcome. Glad to help . Thank You for the feedback


    If you finally get a solution please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".
    - Please click on the *Add Reputation button at the bottom left. you can thank those who have helped

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Counting Unique Long Numbers (>15 digits)

    Also

    =INDEX(FREQUENCY(ROWS(B$2:B2),MATCH($A$2:A2,$A$2:A2,0)),ROWS(B$2:B2))
    Dave

  8. #8
    Registered User
    Join Date
    10-21-2016
    Location
    Kansas City, MO
    MS-Off Ver
    2010, 2013
    Posts
    75

    Re: Counting Unique Long Numbers (>15 digits)

    wk9128, could you help explain what the &"*" adds to the formula? I'm not having luck finding online. Is this wildcard just telling Excel "consider everything in the cell, not just the first 15 characters"?

  9. #9
    Registered User
    Join Date
    10-21-2016
    Location
    Kansas City, MO
    MS-Off Ver
    2010, 2013
    Posts
    75

    Re: Counting Unique Long Numbers (>15 digits)

    Found link online (below) explaining &"*" - thanks, everyone.

    https://www.excel-university.com/vlo...partial-match/

  10. #10
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,408

    Re: Counting Unique Long Numbers (>15 digits)

    ans. Post#8

    This is mainly because Excel can only judge the first 15 digits. If the number exceeds 15 digits, the following digits are directly ignored. Therefore, for bank account numbers, as long as the first 15 digits are the same, the countif() function will consider them to be in the statistics. identical. To solve this problem, it is necessary to cleverly set the statistical conditions of counif(), and connect the wildcard character * after the original condition "A2", and that's it.

  11. #11
    Registered User
    Join Date
    10-21-2016
    Location
    Kansas City, MO
    MS-Off Ver
    2010, 2013
    Posts
    75

    Re: Counting Unique Long Numbers (>15 digits)

    Thank you, wk9128!

+ 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] Last digits in long numbers changed when opening file
    By jp_romano in forum Excel General
    Replies: 4
    Last Post: 10-04-2018, 09:12 AM
  2. Replies: 3
    Last Post: 09-22-2016, 09:40 AM
  3. Need help counting the unique digits ina list of numbers
    By bigtraing in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-10-2013, 08:50 AM
  4. Counting unique numbers
    By aresquare1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-11-2013, 07:18 AM
  5. Counting unique numbers
    By maxnpj in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-13-2009, 11:42 PM
  6. Counting sequences in a long series of numbers
    By Natim9 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-11-2008, 05:20 PM
  7. counting digits, not numbers
    By nebb in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-24-2006, 12:15 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