+ Reply to Thread
Results 1 to 8 of 8

Remove text from cell(s) leaving only certain text?

  1. #1
    Registered User
    Join Date
    08-02-2013
    Location
    Herts, UK
    MS-Off Ver
    Excel 2010
    Posts
    3

    Remove text from cell(s) leaving only certain text?

    [solved, see post by martindwilson for solution with vlookups]

    Hi, bit of a random one I'm not entirely sure what to call..

    Basically, I have a spreadsheet of work orders which is an export from an online database. It has many columns but the one I'm looking at is called "Internal Log" wherein notes are written by staff members. Work orders are given job codes depending on the type of work to be done (ACXX for aircon, FANX for fans, FABX for cabin fabric etc. specially designed to be words/ text that won't appear anywhere else). I am trying to create a pie chart of how the jobs break down into these codes and managed to do this by individually going through each cell in the Internal Log column (for 689 work orders..) and manually removing all the text except for the job code. As I have now been asked to make this a weekly activity I am wondering whether there is an easier way to do it than manually removing information..

    A cell would contain something like this "31/7/13 Go and fix a faulty aircon system. ACXX. 1/2/13 job passed to engineer. 2/2/13 engineer en route.. etc. etc." the job code would be randomly somewhere within all the text, sometimes at the start, sometimes in the middle or at the end..

    I was wondering if there was an easier way than removing the text I don't want in the cell as you can't make a pie chart based on the fact the cell has the word ACXX somewhere in it, the cell needs to contain only the word ACXX, right? I don't expect there's an Excel function to do this, but I was wondering whether there might just be a macro (or maybe a vlookup?) you could use?

    I'm using Excel 2010, don't have a spreadsheet to attach but if it'll help I can knock up a phoney one?


    Many thanks in advance,
    A temp whose told his boss he's a wiz with Excel, then realised the company uses Office 2010 D:
    Last edited by Chestnuts; 08-02-2013 at 09:26 AM. Reason: add resolution info

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Remove text from cell(s) leaving only certain text?

    Okay, knock up a phoney one.

  3. #3
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Remove text from cell(s) leaving only certain text?

    Sample file please...
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.96 for Mac MS 365
    Posts
    8,695

    Re: Remove text from cell(s) leaving only certain text?

    I've done searches on keywords, if you use the filter function you can use text filters to filter on key words, equals... or begins with or contains etc.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Remove text from cell(s) leaving only certain text?

    you can combine lookup with search
    eg with your text in a2 and a list in e1:e3 of
    ACXX
    FANX
    FABX
    then
    =LOOKUP(2^15,SEARCH($E$1:$E$3,A2),$E$1:$E$3)
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Registered User
    Join Date
    08-02-2013
    Location
    Herts, UK
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Remove text from cell(s) leaving only certain text?

    Hey, thanks for all the replies! I have knocked up a phoney one and if I've done it right attached it to this post.

    @martindwilson; your attached sheet looks like what I'm asking for, will this work no matter where in the cell the word ACXX, FANX whatever is? Sometimes it could be at the start of the line of text, sometimes middle or end.. it will always be four letters though!

    Cheers

    Chestnuts



    phoneysheet.xlsx

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Remove text from cell(s) leaving only certain text?

    should do ,see attached
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    08-02-2013
    Location
    Herts, UK
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Remove text from cell(s) leaving only certain text?

    Quote Originally Posted by martindwilson View Post
    should do ,see attached
    That's got it! Thanks so much I knew there had to be a way to do it, I'm just pretty basic at vlookups! Thankyou so much really appreciate it

    Thanks,
    Temp whose just proved he is a wiz with excel :D

+ 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] Remove items from cell, leaving formatting intact.
    By staggers47 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-08-2022, 09:32 AM
  2. [SOLVED] Remove Text+Numbers Sometimes, Based on Other Text in Cell
    By eugeniusjr in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-29-2013, 11:37 AM
  3. [SOLVED] Remove If Statement From Cell Leaving [Value_If_False] From Formula
    By dopeybob435 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-20-2013, 05:53 PM
  4. [SOLVED] Easiest way to remove text from a cell that has text and numbers?
    By cram.it.clownie@gmail.com in forum Excel General
    Replies: 2
    Last Post: 08-17-2006, 01:10 PM
  5. Taking text from a cell leaving Phone#
    By PokerZan in forum Excel General
    Replies: 3
    Last Post: 05-18-2005, 06:05 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