+ Reply to Thread
Results 1 to 7 of 7

Use a formula to return Y if there are duplicates in a column of numbers

  1. #1
    Registered User
    Join Date
    06-30-2010
    Location
    Orlando
    MS-Off Ver
    Excel 2003
    Posts
    14

    Use a formula to return Y if there are duplicates in a column of numbers

    Is there a formula I can use that would return "Y" if there are duplicate numbers in a column?

    I have a column named "IDnumbers" that contains thousand of entries in the column. I just want a quick way to know if there are any duplicate IDnumbers in that column. A quick look that returns either Y or N.

    Thank you.

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Use a formula to return Y if there are duplicates in a column of numbers

    How about using conditional formatting the change the duplicate cells to a certain color like red?
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    06-30-2010
    Location
    Orlando
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Use a formula to return Y if there are duplicates in a column of numbers

    I don't want to use conditional formatting because I just want to know if there is or isn't a duplicate in the column without having to visibly look at the whole column of numbers. But thanks for that suggestion.

  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: Use a formula to return Y if there are duplicates in a column of numbers

    Try this

    =IF(COUNTIF($A$1:$A$9,A1)>1,"Y","")

    Row\Col
    A
    B
    1
    10
    Y
    2
    10
    Y
    3
    654
    4
    5
    5
    12
    Y
    6
    2
    Y
    7
    12
    Y
    8
    32
    9
    2
    Y


    Or this

    =IF(COUNTIF($A$1:A1,A1)>1,"Y","")

    Row\Col
    A
    B
    1
    10
    2
    10
    Y
    3
    654
    4
    5
    5
    12
    6
    2
    7
    12
    Y
    8
    32
    9
    2
    Y
    Last edited by AlKey; 07-07-2015 at 12:44 PM.
    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
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Use a formula to return Y if there are duplicates in a column of numbers

    You can use the following formula -
    =IF(MAX(COUNTIF(A1:A100,A1:A100))>1,"Y","N")
    This is an array formula ...to use this, just copy it from here....click on the cell you want to paste to....press f2...now paste it using CTrl+V and then press Ctrl+Shift+Enter instead of just enter...

    Here A1:A100 is the range which is looked for.
    You can change it....

    Hope that helps!!
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  6. #6
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Use a formula to return Y if there are duplicates in a column of numbers

    Let me tell you, my formula just looks up at the whole array, and just tells if there is a duplicate or not. So it just needs one cell to be placed on where you need a result "Y" or "N"....
    It does not shows which number is having duplicates...
    I did that just because you told that you don't want to visibly lookup the whole array...so you can use my formula to determine if there are any duplicates and then use conditional formula or formula by AlKey to find which value is having duplicates...

  7. #7
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Use a formula to return Y if there are duplicates in a column of numbers

    Sample File Attached....
    Attached Files Attached Files

+ 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: 1
    Last Post: 07-30-2014, 02:37 PM
  2. [SOLVED] To find duplicates in a column and suffix them with numbers to make them unique
    By JishnuSurendran in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-23-2014, 06:34 AM
  3. How to loop through a column and return non duplicates?
    By ip916a4bb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2013, 04:59 PM
  4. Replies: 5
    Last Post: 07-26-2012, 08:46 PM
  5. Can vba code identify duplicates numbers in a column via a message window?
    By lilsnoop in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-27-2012, 07:51 AM

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