+ Reply to Thread
Results 1 to 9 of 9

Subtract text from a text cell

  1. #1
    Registered User
    Join Date
    10-29-2013
    Location
    Albuquerque
    MS-Off Ver
    Excel 2010
    Posts
    24

    Subtract text from a text cell

    Hello! I need to subtract all the text in one cell, from another cell.
    I have for example:

    A1 Airline Bus 70C/3R5 Eagle
    B1 Airline Bus Eagle

    What formula can I use that could give me in cell C1 70R/3R5 ?


    Thanks!

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,423

    Re: Subtract text from a text cell

    I think a few more examples are needed, so we can see the variations which can occur in column B. Please attach a sample file.

    Pete

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Subtract text from a text cell

    try this one

    in B1

    =TRIM(MID(SUBSTITUTE(MID(A1,FIND("/",A1)-3,255)," ",REPT(" ",255)),1,255))

    A
    B
    1
    A1 Airline Bus 70C/3R5 Eagle 70C/3R5
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Registered User
    Join Date
    10-29-2013
    Location
    Albuquerque
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Subtract text from a text cell

    Thanks for the prompt response guys!
    Here an example I just made.


    Book1.xlsx

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Subtract text from a text cell

    I am looking at your file and but I don't think I understand it. Care to elaborate more on what exactly you need?

    Thanks
    Last edited by AlKey; 07-25-2014 at 01:07 PM.

  6. #6
    Registered User
    Join Date
    10-29-2013
    Location
    Albuquerque
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Subtract text from a text cell

    Hello AlKey,

    Sorry I thought was already very simple!! I want to subtract the text in column B from the text in column A, and display it in column C!
    So, if I have in cell A the sentence "This is your forum" and in cell B the words "is your", cell C should display "This forum" (This is your forum - is your = This forum)
    Hope this time is clear!
    Thanks!

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Subtract text from a text cell

    Unfortunately, there appears to be no logic, at least not obvious to me, or any particular order in which this task can be accomplished. These parts of the string can be extracted but the formula will not work on anything else for the reasons stated earlier.

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,423

    Re: Subtract text from a text cell

    Put these formulae in the cells stated:

    D1: =LEFT(B1,FIND(" ",B1))
    E1: =LEFT(SUBSTITUTE(B1,D1,""),FIND(" ",SUBSTITUTE(B1,D1,"")))
    F1: =SUBSTITUTE(B1,D1&E1,"")
    G1: =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,D1,""),E1,""),F1,"")

    then copy down, as in the attached file. This assumes that you have 3 words to be replaced each time, as your example shows.

    Hope this helps.

    Pete
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-29-2013
    Location
    Albuquerque
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Subtract text from a text cell

    Great Pete! Thanks!!! That's exactly what I was looking for

+ 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. Subtract text in one cell from another?
    By BigIan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-07-2005, 05: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