+ Reply to Thread
Results 1 to 3 of 3

Extract text from a string of text (amend formula to include new criteria)

  1. #1
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Question Extract text from a string of text (amend formula to include new criteria)

    Hi

    I posted a question earlier to Extract text from a string of text which 'hlpplease' kindly answered see i.e. http://www.excelforum.com/excel-gene...g-of-text.html

    However, whilst the formula =LEFT(A1,SEARCH(" -",A1)-1) works as required I've now realised that some of the data only has three characters anyway and therefore returns a #VALUE! in this case.

    Is it possible to amend the formula to also check if there is not a – in the text and return the text as is

    e.g.

    NRB - LNG-LIC the expected output would be NRB

    TRM ELECTRIC - BSG-INFS the expected output would be TRM ELECTRIC

    TRM GAS - TRM-ASMN-ENI the expected output would be TRM GAS

    TRM GAS the expected output would be TRM GAS

    TRM ELECTRIC the expected output would be TRM ELECTRIC

    NRB the expected output would be NRB


    Any assistance would be greatly appreciated


    Many thanks in advance

    Rob



    !
    Rob

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Extract text from a string of text (amend formula to include new criteria)

    Rob,

    Give this a try:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Re: Extract text from a string of text (amend formula to include new criteria)

    tigeravatar,

    EXCELLENT just what I wanted !! You and 'hlpplease' are STARS

    Many many thanks

+ 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. AVERAGEIFS() with criteria that a string NOT include specific text
    By tjnelso in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2013, 07:30 PM
  2. what formula to extract text from a long string?
    By SEMMatt in forum Excel General
    Replies: 5
    Last Post: 10-07-2012, 10:23 PM
  3. formula to extract a section of of a text string
    By dcgrove in forum Excel General
    Replies: 6
    Last Post: 07-02-2010, 11:28 AM
  4. Extract Math Formula from text string
    By jpao in forum Excel General
    Replies: 2
    Last Post: 07-01-2010, 03:42 AM
  5. [SOLVED] Formula to extract digits from a text string?
    By [email protected] in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-15-2006, 12:16 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