+ Reply to Thread
Results 1 to 13 of 13

function to isolate duplicate numbers

  1. #1
    Forum Contributor
    Join Date
    06-24-2012
    Location
    Australia
    MS-Off Ver
    Office365
    Posts
    302

    function to isolate duplicate numbers

    Hi Experts,
    in a given cell consisting 0 to 7 digits has mix numbers e,g,

    957, 1315, 1357399, 13579 are given numbers ; function to give result for these, blank, 1,39, blank

    I am now using office365

    thanks
    karnik

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: function to isolate duplicate numbers

    Please update your forum profile NOW.

    Explain the logic here - I do not see any correlation.

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. The sample layout accurately matches that of your real data. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    06-24-2012
    Location
    Australia
    MS-Off Ver
    Office365
    Posts
    302

    Re: function to isolate duplicate numbers

    Hi Ali,
    thanks for suggestion, file is uploaded
    karnik
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: function to isolate duplicate numbers

    Quote Originally Posted by Karnik View Post
    I am now using office365
    You should update your profile then.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: function to isolate duplicate numbers

    I have already told the OP to do so - no help to be offered until this is done.

    Once the profile has been updated, please explain the logic of this (which I asked you to do earlier). There are no clues here to your thinking at all.

    AliGW on MS365 Beta Channel (Windows 11) 64 bit

    A
    B
    1
    given
    results
    2
    975
    3
    1135
    11
    4
    1351
    11
    5
    13759
    6
    553979
    59
    7
    1113799
    19
    Sheet: Sheet1
    Last edited by AliGW; 03-29-2024 at 02:25 AM.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: function to isolate duplicate numbers

    You PMd me to say that your profile has been updated, but it has not - it still shows Excel 2019. Please update it to 365 and then we can proceedd with the thread

  7. #7
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,433

    Re: function to isolate duplicate numbers

    I understand what you want and have a solution for it.

    Please update your MS-off version in your profile to Office 365.
    Then I am allowed to post the solution.

  8. #8
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,913

    Re: function to isolate duplicate numbers

    ... .

  9. #9
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,433

    Re: function to isolate duplicate numbers

    Here are 2 different solutions:

    Please try and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    or try and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    10-22-2022
    Location
    Santa Cruz, Bolivia
    MS-Off Ver
    MSO 365
    Posts
    146

    Re: function to isolate duplicate numbers

    great couple of formulas Hans!!

    I allow me to propose this alternative solution:

    Please Login or Register  to view this content.
    I hope it results useful.

    Isolate duplicate numbers (solution).xlsx

  11. #11
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,416

    Re: function to isolate duplicate numbers

    This single formula will produce results for the entire specified range (change as needed)...
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  12. #12
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    Germany
    MS-Off Ver
    365
    Posts
    491

    Re: function to isolate duplicate numbers

    Quote Originally Posted by Rick Rothstein View Post
    This single formula will produce results for the entire specified range (change as needed)...
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Rick, would you mind sharing a bit of commentary how this formula works/what it does?
    I can't really follow :/

  13. #13
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,416

    Re: function to isolate duplicate numbers

    @RaulSerg,

    Sure, let me give it a try...

    First, the problem was to list all the digits within a number that repeat within that number. So, if the number were 528593312, then only the digits 2, 3 and 5 repeat (the other digits appear only once each) and so the returned value should be 235. So, to attack this problem, I use this to count the number of times a given digit appeared with the individual number to see if that number of times was greater than one or not...

    LEN(r)-LEN(SUBSTITUTE(r,x,""))>1

    Next comes the tricky part of my formula and probably what threw you in understanding it. I used the number of times the given digit repeated as the second argument in the LEFT function call. If the number of times the digit repeated was zero or one, then the above logical expression would return FALSE, which the LEFT function's second argument equates to zero, and so the LEFT function would return zero characters from the first argument. If the number of times the digit repeated was greater than one, then the logical expression would return TRUE which the LEFT function's second argument equates to 1 and, since the first argument is a single digit, that digit is returned. The REDUCE function feeds the individual digits from 0 to 9 (via the SEQUENCE function) into the above described calculation (via the LAMBDA function) which are then concatenated together by the ampersand character. Remember, either a digit that appears more than once or an empty text string ("") is being concatenated thus producing the requested outcome. Finally, each cell in A2:A7 is being treated, one at a time inside the REDUCE function call via the variable named 'r'. The reason this all works for the entire range is because the LEFT, LEN and SUBSTITUTE combination of functions work correctly with dynamic arrays, hence, the whole range gets processed cell by cell.
    Last edited by Rick Rothstein; 04-03-2024 at 03:05 PM.

+ 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] Isolate couple of numbers from a string
    By tanpa_nama in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-27-2018, 04:20 AM
  2. [SOLVED] Isolate numbers in alphaneumeric item number
    By Patish in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-13-2016, 04:32 PM
  3. Replies: 15
    Last Post: 11-28-2014, 07:10 AM
  4. [SOLVED] Help! How do I isolate numbers from a name
    By pwall1115 in forum Excel General
    Replies: 3
    Last Post: 02-16-2013, 10:44 AM
  5. Find and isolate duplicate criteria
    By LD2020 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-07-2009, 10:57 AM
  6. isolate numbers in a cell
    By jeremy via OfficeKB.com in forum Excel - New Users/Basics
    Replies: 10
    Last Post: 06-08-2005, 07: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