+ Reply to Thread
Results 1 to 5 of 5

Extract until next criteria

  1. #1
    Registered User
    Join Date
    08-08-2018
    Location
    Indiana
    MS-Off Ver
    Office 365
    Posts
    20

    Extract until next criteria

    Hello Excel friends,

    A file is attached with examples in the second sheet. There are two columns in sheet 1 which need sorted into four columns. I know how to do this when the number of cells between each criteria is equal, but that's not the case here.

    A cell will contain six characters, beginning with a number, then names below that, and I would need to extract all of the names corresponding to each size character cell. 1DWAGA might have Smith and Albert under it, and those need to be in two rows rather than all in one column.

    If I could create some index or vlookup which extracts all information up to the next cell that begins with a number, that would be one thing, but I'm stuck here.

    Any help on this puzzle is appreciated!
    Attached Files Attached Files

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Extract until next criteria

    Hi

    Try this with helper columns in C5, D5 and E5 respectively, and drag down
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The table must be ended with a value in column B (in the sample I set B1000 with 0)

    See the file for clarification
    Attached Files Attached Files

  3. #3
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Extract until next criteria

    Hi

    I add some adjusts

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


    and the file
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    08-08-2018
    Location
    Indiana
    MS-Off Ver
    Office 365
    Posts
    20

    Re: Extract until next criteria

    Hmm, that's very interesting, but there's no first name field, and even if I got rid of the extra info in the cabin and booking fields, there's lots of things in the last name field that shouldn't be there either.

    I'm not sure there's a clever way to do this, since some cabins contain people with two different last names. I feel like the unique records might need filtered to a separate column first, and then separated from there, but the names would be the issue at that point..

    Anything with a Mr or Mrs next to it is a first name, anything without is a last name, and anything with a 4 digit pattern next to it is a booking number/cabin number. Hmm.

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Extract until next criteria

    Please try at

    D5
    =INDEX(A:A,MATCH(E5,$B$1:$B$999,))

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


    F5
    =INDEX($A:$A,MATCH($E5,$B$1:$B$999,)+COUNTIF($E$5:$E5,$E5))

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



    But not 100% work because some names are not in pairs. I couldn't figure out how to separate that.
    Attached Files Attached Files
    Last edited by Bo_Ry; 11-20-2018 at 12:59 AM.

+ 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] Extract table with criteria
    By rajeshn_in in forum Excel Formulas & Functions
    Replies: 26
    Last Post: 01-10-2017, 10:29 AM
  2. Replies: 8
    Last Post: 05-08-2016, 12:48 AM
  3. Replies: 0
    Last Post: 05-02-2016, 07:59 AM
  4. [SOLVED] Extract number with criteria
    By Jhon Mustofa in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-03-2015, 02:23 AM
  5. Replies: 3
    Last Post: 12-18-2014, 10:27 AM
  6. Extract data with 2 criteria
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-15-2012, 06:48 PM
  7. Extract Data_Under certain Criteria
    By manuel1991 in forum Excel General
    Replies: 2
    Last Post: 10-25-2012, 03:19 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