+ Reply to Thread
Results 1 to 7 of 7

extract unique list then list the sequential numbers as ranges

  1. #1
    Registered User
    Join Date
    02-06-2013
    Location
    On the Globe
    MS-Off Ver
    Excel 2010
    Posts
    5

    extract unique list then list the sequential numbers as ranges

    Hi,
    I need to extract the unique list of column A to column D, then list the sequential numbers (as ranges separated by dash) and the individual ones in B to column E, F, etc. as shown in the attached file.

    Any help is very much appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: extract unique list then list the sequential numbers as ranges

    Your desired output can only be accomplished with VBA. Is the an allowable method? Do you have any experience with VBA?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-06-2013
    Location
    On the Globe
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: extract unique list then list the sequential numbers as ranges

    @JBeaucaire

    Yes, I have some experience with VBA, and I can implement it.

    Thanks

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: extract unique list then list the sequential numbers as ranges

    Assuming

    1) a workbook with two sheets named:

    Data
    Output


    2) data on the Data sheet starting A1 with headers in row 1

    The following macro will generate the outpout sheet in your chosen result:
    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 07-04-2016 at 11:03 AM.

  5. #5
    Registered User
    Join Date
    02-06-2013
    Location
    On the Globe
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: extract unique list then list the sequential numbers as ranges

    Thank you JBeaucaire
    I applied it on a bit larger scale of data, it throws a mismatch error at:
    wsOUT.Cells(NR, Columns.Count).End(xlToLeft).Offset(, 1).Value = FirstSub & "-" & NextSub

    I couldn't figure out what might be the issue.
    Attached Files Attached Files

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: extract unique list then list the sequential numbers as ranges

    Typo in the macro, marked in red above. It's working now.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-06-2013
    Location
    On the Globe
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: extract unique list then list the sequential numbers as ranges

    Yes, working now.

    Thank you very much

+ 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. Assign sequential numbers to unique values in a list
    By penfold in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-30-2017, 02:11 PM
  2. Replies: 6
    Last Post: 07-11-2015, 08:02 PM
  3. [SOLVED] re-numbering a list of numbers based on another list of numbers to get a sequential order
    By ryan.wherry in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-10-2014, 03:27 PM
  4. Replies: 8
    Last Post: 01-10-2014, 10:55 AM
  5. Extract unique numbers from a list
    By excelbee in forum Excel General
    Replies: 7
    Last Post: 08-11-2012, 09:00 AM
  6. Replies: 2
    Last Post: 05-24-2012, 05:05 PM
  7. how to extract unique numbers once from a list of repeated numbers?
    By stuart.kwok@gmail.com in forum Excel General
    Replies: 2
    Last Post: 05-02-2006, 11:20 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