+ Reply to Thread
Results 1 to 7 of 7

Extract 4 digit common numbers from 5 digit numbers

  1. #1
    Registered User
    Join Date
    06-22-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Extract 4 digit common numbers from 5 digit numbers

    Hi,

    trying to find a formula to extract a common 4 digit number from a list of 5 digit numbers

    example:

    12345
    23456
    22345
    23457
    41236
    56789

    2345 would be the common number for the above list. i know MODE can be used but only if the lists are all 4 digits.

    thanks in advance.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Extract 4 digit common numbers from 5 digit numbers

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


    ...confirmed by pressing CTRL-SHIFT-ENTER to activate the array. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL-SHIFT-ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Extract 4 digit common numbers from 5 digit numbers

    Try this, Adjust the range to suit your workbook.

    Please Login or Register  to view this content.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  4. #4
    Registered User
    Join Date
    06-22-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Extract 4 digit common numbers from 5 digit numbers

    Thanks Sixthsense

    this helped a lot.

    how do i extract a 3 digit common (frequent) number from the same list using the same formula?

    JapanDave,

    not quite sure if this can help extract the frequent numbers i need from the list above. but thanks anyway.

  5. #5
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Extract 4 digit common numbers from 5 digit numbers

    Try the file
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-22-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Extract 4 digit common numbers from 5 digit numbers

    JapanDave,

    yes i tried this but what i really want is the worksheet to find the most frequent numbers from the list using the MODE function like Sixthsense gave.

    another problem im getting is that the result will get no value / error when number start from 0.

    example

    31872
    69633
    02164
    02168
    18464
    54976

    most common number should be 0216. how to rectify this? thanks.

  7. #7
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Extract 4 digit common numbers from 5 digit numbers

    Try this...

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


    ...confirmed by pressing CTRL-SHIFT-ENTER to activate the array. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL-SHIFT-ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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