+ Reply to Thread
Results 1 to 6 of 6

How to extract values from a cell into multiple columns based on criteria

  1. #1
    Registered User
    Join Date
    01-27-2016
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    3

    How to extract values from a cell into multiple columns based on criteria

    Hi everyone. I have an array of cells with multiple records in each cell. I need to sort the data in a way that each type of record is located in a separate column.
    Types of records in the cells:
    1. Starting from 45...
    2. Starting from 10...
    3. Starting from 40...
    4. Starting from 2...

    So I need that all records that start from 45 would be located in the same column; records that start from 2 - in another column and so on.
    Thank you for advice.
    Data.xlsx

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: How to extract values from a cell into multiple columns based on criteria

    This was a fun exercise, thanks. It does take a few seconds to run, so likely loading all your data into an array would be a faster approach, but hey, that ain't my style.

    Please Login or Register  to view this content.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  3. #3
    Registered User
    Join Date
    01-27-2016
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    3

    Re: How to extract values from a cell into multiple columns based on criteria

    Thank you, walruseggman! The code runs as expected. I forgot to mention one critical element, though

    Each line has a Record ID, so references from the line should stay in the same row and stay attached to the original Record ID
    (please see the updated data file attached).

    For example: row 2 has the Record ID 38374287, so all references from this row should stay attached to this record ID, which I will need to reconcile with other documents later.

    Sorry for incomplete question...
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: How to extract values from a cell into multiple columns based on criteria

    Sorry, I don't understand what you want. Can you please attach a sample output of what you want the code to do? Ten or so lines, just enough to make it clearer what the output is.

  5. #5
    Registered User
    Join Date
    01-27-2016
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    3

    Re: How to extract values from a cell into multiple columns based on criteria

    Absolutely and thank you for looking into this.
    In the attached file - DATA = source data, SAMPLE OUTPUT = desired output results
    Thanks!
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: How to extract values from a cell into multiple columns based on criteria

    Please Login or Register  to view this content.

+ 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. Sum values based on multiple criteria in rows and columns
    By mattadler22 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-20-2015, 03:09 AM
  2. Replies: 1
    Last Post: 07-14-2015, 06:46 AM
  3. [SOLVED] Extract Unique Text Values based on Multiple Criteria
    By Kattenhove in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-26-2014, 07:59 AM
  4. [SOLVED] Sum if based on two criteria and values in multiple rows and columns
    By Alkina in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-15-2013, 09:18 AM
  5. [SOLVED] Requesting help returning text values from criteria based on multiple columns
    By dzarrabi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-15-2013, 08:16 AM
  6. [SOLVED] Copy/Paste multiple columns as values based on another columns criteria
    By Dgp2012 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-28-2013, 06:50 AM
  7. Replies: 1
    Last Post: 02-14-2013, 02:32 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