+ Reply to Thread
Results 1 to 4 of 4

Multiple If Statement to Strip Text at End

  1. #1
    Registered User
    Join Date
    01-10-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Multiple If Statement to Strip Text at End

    I've been trying to get this multiple if statement to work, but I can't seem to get it right. I have a large list of cells with procedures that have the laterality indicated at the end: i.e:

    LASIK SURGERY OD
    LASIK SURGERY OS
    LASIK SURGERY OU

    I'm trying to strip the OD,OS,OU with a long nested IF that uses ISERR,LEFT,and FIND but no such luck.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Multiple If Statement to Strip Text at End

    Can you post more samples?
    I'm guessing there are more letter patterns to be found...maybe more than just 2 letters?
    What are ALL of the rules?

    Meanwhile...if there are always 2 letters to be removed from the end of the text, try this:
    A1: My Test Text OS
    This formula returns that text without the trailing letters
    Please Login or Register  to view this content.
    In that example, the formula returns: My Test Text
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    01-10-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Multiple If Statement to Strip Text at End

    Yea, sorry. The list of cells also have the more user friendly English definition as well as the Latin abbreviation:

    REFRACTIVE SURGERY OS (LEFT EYE)
    OPTOS COLOR PHOTO OS (LEFT EYE)
    OCT MACULA CIRRUS OD (RIGHT EYE)
    VISUAL FIELD 10-2 OD (RIGHT EYE)
    OCT MACULA HEIDELBERG OD (RIGHT EYE)
    HESS SCREEN TEST - OU (BOTH EYES)
    CORNEAL TOPOGRAPHY NIDEK OU (BOTH EYES)
    OCT OPTIC NERVE STRATUS OU (BOTH EYES)
    BSCAN OU (BOTH EYES)
    LUCENTIS (RANBIZUMAB) INTRAVITREAL INJECTION OD (RIGHT EYE)
    LUCENTIS (RANBIZUMAB) INTRAVITREAL INJECTION OS (LEFT EYE)



    So I'm attempting to use something like:

    Please Login or Register  to view this content.
    But within a nested IF that factors in all three possibilities.

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Multiple If Statement to Strip Text at End

    Perhaps

    =LEFT(A1,SEARCH(" O? ",A1&" ")-1)

+ 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] How do I strip punctuation from end of text?
    By egavasrg in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-07-2011, 04:26 AM
  2. How to strip text from a cell
    By gurp99 in forum Excel General
    Replies: 11
    Last Post: 01-29-2011, 06:38 PM
  3. Strip text in cell
    By buddhajb in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-30-2008, 01:47 PM
  4. [SOLVED] Strip out text copy and paste?
    By Mark Y via OfficeKB.com in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 12-07-2005, 09:20 AM
  5. Strip text before character
    By bell23 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-29-2005, 06: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