+ Reply to Thread
Results 1 to 11 of 11

Separate Words from List Into Columns

  1. #1
    Forum Contributor
    Join Date
    09-19-2003
    Posts
    226

    Separate Words from List Into Columns

    Hi

    Hope you can help me. I have a list in Column A. The list is a sample of a much longer one. Specific words or a combination of two words appear anywhere in the cell as you can see in column A. Column A is the original list. I'm looking to separate the list into three columns: The Outlet (B), the Charge Type(C) and either "Allowance" or "Disc"(D). In columns H, I and J I gave each range a dynamic name because if any word does not appear within those ranges they should not appear in columns B, C or D. I have left empty cells in each range so I can add words if the need arises.

    Somehow I feel VLookup is the solution, but I could be wrong. I'll leave up to you.

    I'd appreciate your feedback.

    Many thanks

    patish
    Attached Files Attached Files
    Patish

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,913

    Re: Separate Words from List Into Columns

    Try this in B2:

    =IFERROR(LOOKUP(2,1/SEARCH($H$2:$H$6,$A2),$H$2:$H$6),"")

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

    Re: Separate Words from List Into Columns

    Quote Originally Posted by Phuocam View Post
    Try this in B2:

    =IFERROR(LOOKUP(2,1/SEARCH($H$2:$H$6,$A2),$H$2:$H$6),"")
    That can be reduced to:

    =IFERROR(LOOKUP(1000,SEARCH($H$2:$H$6,$A2),$H$2:$H$6),"")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Contributor
    Join Date
    09-19-2003
    Posts
    226

    Smile Re: Separate Words from List Into Columns

    Hi Tony

    Thanks for your quick response.

    What is the 1000? Can't include blank cells?

    Perfect solution.

    Patish

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

    Re: Separate Words from List Into Columns

    Here's an explanation I wrote to a very similar question:

    https://www.excelforum.com/showthread.php?p=4492401

  6. #6
    Forum Contributor
    Join Date
    09-19-2003
    Posts
    226

    Re: Separate Words from List Into Columns

    Hi again

    Thanks for the explanation, Tony. Tony, I noticed, when I looked further down the list that, after a certain rown the formula was throwing back blanks in all the columns where it should not have. Also, in the rows where at least one or two results were appearing there were others that returned blank.

    I checked Phuocam formula and it worked perfectly. I'll be happy to send you examples of those sections that throw up incorrect results.

    Thank you both for your feedbacks

    Patish

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

    Re: Separate Words from List Into Columns

    Quote Originally Posted by Patish View Post
    I'll be happy to send you examples of those sections that throw up incorrect results.
    Yes, please.

  8. #8
    Forum Contributor
    Join Date
    09-19-2003
    Posts
    226

    Re: Separate Words from List Into Columns

    Gentlemen

    With my tail between my legs I grovel my apologies. I used both the formulaes next to each other and they both return the same results- PERFECTION WAS GUARENTEED!!! Don't know what happened there. My apologies, Tony. Is there no Post Icon that shows "dying of embarassment"? Whew, it's suddenly hot in here.

    May I be so bold as to ask why in the example you linked, did you place the 1E100 instead of 1000?

    Thanks both of you.

    Patish

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

    Re: Separate Words from List Into Columns

    Quote Originally Posted by Patish View Post
    May I be so bold as to ask why in the example you linked, did you place the 1E100 instead of 1000?
    It was just a matter of convenience.

    A cell can hold a maximum of 32,767 characters.

    So, that means the SEARCH function will return either an error (when no keywords are found) or a number from 1 to 32,767.

    So, the lookup value has to be a number that is larger than the number of characters in the cell(s).

    Based on the data in your sample file the cells did not contain that many characters so I arbitrarily chose to use 1000 as the lookup value.

    Both formulas do the exact same thing. The one I suggested goes about it slightly more efficiently. It takes one less calculation process to arrive at the result.

  10. #10
    Forum Contributor
    Join Date
    09-19-2003
    Posts
    226

    Re: Separate Words from List Into Columns

    Thank you Guru.

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

    Re: Separate Words from List Into Columns

    You're welcome!

+ 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. Replies: 2
    Last Post: 09-12-2015, 07:54 PM
  2. Help: take values from many columns into one list, separate list to new worksheets
    By celestealexandra in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-07-2013, 05:44 PM
  3. [SOLVED] VBA issue - trying to separate words with CAPITALS from Proper words
    By Eagle29 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-24-2013, 04:22 AM
  4. Replies: 4
    Last Post: 04-25-2013, 03:05 PM
  5. Replies: 2
    Last Post: 06-28-2011, 10:29 AM
  6. Separate a list to columns
    By mpquin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-28-2007, 04:06 PM
  7. [SOLVED] How do I separate words in one cell into two cells?-manually separate hundreds of nam
    By Vanessa in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-08-2005, 11:05 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