+ Reply to Thread
Results 1 to 2 of 2

Pulling data from jumbled columns

  1. #1
    Registered User
    Join Date
    09-24-2008
    Location
    Arlington, TX
    Posts
    1

    Pulling data from jumbled columns

    Hello, new here.

    What I am trying to do is confusing me. I have a database exporting a lot of information. What I am specifically trying to pull from the data is a 5 digit code. this may be 5 numbers, or 5 letters, or (more often) a combination of the two.

    The export has a ton of records (about 5,000 and growing) so manual withdrawal is not an option.

    So, in column A is the part number, which isn't necessarily important.
    Column B says "TEXT A, TEXT B, TEXT C, CODE, TEXT D, TEXT E"
    Column C says "AAA, BBB, CCC, 12345, DDD, EEE"

    So, at first glance I thought I would use Text To Columns, and just pull all the codes from that column. However, it gets worse

    the column moves around in the database. Sometimes it's 4th, sometimes 11th, and sometimes it's first and there are no other columns;

    so it might be
    Column B says "CODE"
    Column C says "12345"

    or
    Column B says "CODE, TEXT A, TEXT B, TEXT C, TEXT D, TEXT E"
    Column C says "12345, AAA, BBB, CCC, DDD, EEE"

    Does anyone have any ideas on how to pull this data out? I thought if I search for CODE and find what column it is, then pull a corresponding column, it might work, but that didn't work

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Pulling data from jumbled columns

    With
    B1 containing column headings, separated by commas.
    eg CODE, TEXT A, TEXT B, TEXT C, TEXT D, TEXT E
    and
    C1 contains column values, separated by commas.
    eg 12345, AAA, BBB, CCC, DDD, EEE

    These formulas deteremine which column position in B1 contains the CODE
    and returns the 5-digit code value from C1

    This formula counts the number of commas in the left text that includes
    the word CODE:
    Please Login or Register  to view this content.
    This formula returns the 5-digit code value
    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

+ 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. Convert Columns to rows with DATA
    By raed_237 in forum Excel General
    Replies: 6
    Last Post: 08-05-2008, 04:18 AM
  2. Columns with Data in Range
    By additude in forum Excel General
    Replies: 9
    Last Post: 07-25-2008, 08:11 AM
  3. How can I speed up this slow macro?
    By rs2k in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-18-2008, 08:34 PM
  4. Move Blocks Of Data In Columns To Rows
    By phillim in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2008, 03:27 PM
  5. Many Ols Regressions on Many Columns of Data
    By Carpenter9 in forum Excel General
    Replies: 0
    Last Post: 09-12-2006, 02:32 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