+ Reply to Thread
Results 1 to 6 of 6

Return multiple string values

  1. #1
    Registered User
    Join Date
    11-24-2014
    Location
    norway
    MS-Off Ver
    2010
    Posts
    37

    Return multiple string values

    Dear excel pros!

    I have a table with multiple strings in one column (there are also several cells withOUT any strings). The table looks like this:

    A
    1
    Name
    2
    John
    3
    Name
    4
    5
    Alex
    Table 1

    Note: The real table is much longer than this. Otherwise this would be fairly easy..

    Now, what I want to do, is to copy all of the strings from column A (in Table 1) to a new table (Table 2). However, I don't want to copy the empty cells nor the cells with the "Name" string. The result should look like this:

    A
    1
    John
    2
    Alex
    3
    Table 2

    I appreciate all the help you can provide!

    My thoughts:
    I think that the formula in f.x cell "A1" in "Table 2" (the result table), must start searching in "Table 1" for any strings except "Name". If the formula finds any string/text, it must return the value to cell A1. The formula in "A2" must then start its search from the cell that contained text (the result from cell A1).

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Return multiple string values

    Try this...

    Data Range
    A
    B
    1
    ------
    ------
    2
    Name
    John
    3
    John
    Alex
    4
    Name
    5
    6
    Alex
    7
    8
    9
    10


    This array formula** entered in B2:

    =IFERROR(INDEX(A:A,SMALL(IF((A$2:A$10<>"")*(A$2:A$10<>"Name"),ROW(A$2:A$10)),ROWS(B$2:B2))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down until you get blanks.

    You may have to replace the commas with semi-colons.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    11-24-2014
    Location
    norway
    MS-Off Ver
    2010
    Posts
    37

    Re: Return multiple string values

    Wow, Thank you! But I get Alex two times, and no John. If I change the formula from "SMALL" to "LARGE" I get John two times, and no Alex. Like this:

    A
    1
    Alex
    2
    Alex
    3

    If I remove the argument "SMALL/LARGE", I get nothing..

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Return multiple string values

    Here's a small sample file that demonstrates this.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-24-2014
    Location
    norway
    MS-Off Ver
    2010
    Posts
    37

    Re: Return multiple string values

    Thank you so much! Now it works perfectly!

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Return multiple string values

    You're welcome. Thanks for the feedback!

+ 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] Search a string from a column, and return multiple values
    By newroads in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-11-2015, 03:43 PM
  2. Replies: 2
    Last Post: 05-14-2015, 01:30 PM
  3. Script to Search for a specific String then return cell values above that String-4
    By owensjb2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-03-2015, 01:28 AM
  4. [SOLVED] Script to Search for a specific String then return cell values above that String-3
    By owensjb2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-01-2015, 01:50 PM
  5. [SOLVED] Script to Search for a specific String then return cell values above that String-2
    By owensjb2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-01-2015, 01:00 PM
  6. [SOLVED] Script to Search for a specific String then return cell values above that String
    By owensjb2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-01-2015, 11:28 AM
  7. Help! Formula: Look up multiple text string and return multiple values
    By Kchiolero in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-23-2014, 03:06 PM

Tags for this Thread

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