+ Reply to Thread
Results 1 to 10 of 10

Extracting a word from a cell

  1. #1
    Forum Contributor
    Join Date
    11-11-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    129

    Extracting a word from a cell

    I work for an Automotive IT Comapny and I'm trying cross check all the charges we make against what we are charged by a 3rd party supplier. Of course what we narrate in our billing is different to what they narrate, so I'm trying to extract the franchise from their text to then be able to do the cross checking with our narration on our invoicing.

    I've tried to use formula's such as Search, Left, Right, but I want a column to actually display the outcome of which franchise we've been charged for, not just that there is a franchise in the text cell. The Left/Right formula's don't work due to length of the franchises and their different descritions in the narration.

    Is there any way I can achieve what I'm after? Thank in advance.

    I've attached a sample of what I am trying to achieve. (Note. I have now included a few examples of what I want to achieve)
    Attached Files Attached Files
    Last edited by Fletch74; 11-24-2013 at 11:07 PM.

  2. #2
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Extracting a word from a cell

    This is a good start, but are we supposed to get the franchise name without something to compare against?
    some are in the 4th word, some are in 3rd word, some are in last position, some in second to last position,some are unknown, so how do we decide the the franchise to look for, even if there is no multiple franchises within the description, without a list, how do we find them ?
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Extracting a word from a cell

    like dredwolf mentioned, we would need a list of the franchise somewhere. say i put the list in E2:E8
    Kia
    Ford
    Suzuki
    Holden
    Hyundai
    Honda
    Mitsubishi

    then in C2:
    =LOOKUP(2^15,SEARCH(" "&$E$2:$E$8&" "," "&A2&" "),$E$2:$E$8)

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Forum Contributor
    Join Date
    11-11-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Extracting a word from a cell

    Ok, I can do a list of Franchises that's simple enough. I was trying to run a if((search)+(search)+(search)=0,"No",Yes") formula, but that didn't work.

    Can I ask what the 2^15 refers to?

  5. #5
    Forum Contributor
    Join Date
    11-11-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Extracting a word from a cell

    Thanks dredwolf, and benishiryo. It works well.

  6. #6
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Extracting a word from a cell

    you're welcome. SEARCH returns the position number of what you're looking for. the max number of characters a cell can hold in Excel 2007 & above is 32,767. 2^15 will give you 32,768. so it's just a number big enough so that it returns the last number.

  7. #7
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Extracting a word from a cell

    You are welcome, and thank you ben for the back-up

  8. #8
    Valued Forum Contributor
    Join Date
    10-29-2012
    Location
    Mojokerto,Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    554

    Re: Extracting a word from a cell

    try this formula without helper column

    =TRIM(RIGHT(SUBSTITUTE(LEFT(A2,FIND("-",A2&" -")-2)," ",REPT(" ",LEN(A2))),LEN(A2)))

  9. #9
    Forum Contributor
    Join Date
    11-11-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Extracting a word from a cell

    Thanks Gozi, but it was probably not a good enough example as there are items without "-" so it didn't work in this case, but thanks for your time.

  10. #10
    Forum Contributor
    Join Date
    11-11-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Extracting a word from a cell

    One more question regarding this. If I had more than one franchise in a cell that I wanted to extract, is there anyway of listing them all?

    Cheers

+ 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] Extracting word for number of specific lenth to other cell
    By parajf in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-11-2012, 09:51 PM
  2. Replies: 0
    Last Post: 06-15-2011, 02:22 PM
  3. Extracting a Word from a cell that contains a sentence
    By onuwayhid in forum Excel General
    Replies: 1
    Last Post: 02-07-2008, 12:43 PM
  4. Extracting specific word in a cell
    By Conditional Formatting in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-14-2006, 06:00 PM
  5. Extracting All But Last Word
    By Steve Madden in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-16-2006, 01:25 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