+ Reply to Thread
Results 1 to 6 of 6

Thread: Insert Character and Text within Cell that already contains a word

  1. #1
    Forum Contributor meyero90's Avatar
    Join Date
    03-24-2010
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    177

    Insert Character and Text within Cell that already contains a word

    Hello,

    I'd like to know if anyone has a formula to do the following:
    Assume I have a bloomberg ticker "BB LN", but I want a formula that will make this word appear like "BB/ LN Equity" (with the slash + "Equity" at this end of the text).
    I wrote a formula like =IF(ISERROR(SEARCH("*WG LN*",F46,1)),"","WG/ LN Equity ").
    You'll note that this formula is inefficient since I have to write the element WG LN (in the 1st part of the formula) or take it off and simply replace it by F46 (which would give SEARCH(F46,F46,1), which would at least enable me to drag down the column to change the targeted text, BUT here's where it gets complicated: I also want to be able in the last argument of the formula to automatically "WG" to be changed in respect to F46 and insert "/" + "Equity".
    It sounds complicated but I'm sure there's a way to fix my problem.

    An example is attached in my spreadsheet, should help you better understand my issue

    Thank you in advance for your help
    Attached Files Attached Files
    Last edited by meyero90; 04-23-2010 at 04:36 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    MS 2007
    Posts
    5,372

    Re: Insert Character and Text within Cell that already contains a word

    Try this
    =SUBSTITUTE(A2," ","/ ",1)&" Equity"
    Does that work for you?
    ChemistB
    My 2¢

    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

  3. #3
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,786

    Re: Insert Character and Text within Cell that already contains a word

    to get results you have in col b
    =LEFT(A2,FIND(" ",A2)-1)&"/ ln equity"
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and a dabbler in Cisco
    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

  4. #4
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Insert Character and Text within Cell that already contains a word

    Is A4 and B4 a match?

    If not:

    =IF(ISNUMBER(SEARCH(TRIM(SUBSTITUTE(SUBSTITUTE(B2,"/",""),"Equity","")),TRIM(A2))),SUBSTITUTE(B2,"Equity","")&"Equity","")

    if yes,

    =IF(ISNUMBER(SEARCH(TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B2," ",""),"/","*"),"Equity","")),TRIM(A2))),SUBSTITUTE(B2,"Equity","")&"Equity","")
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  5. #5
    Forum Contributor meyero90's Avatar
    Join Date
    03-24-2010
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    177

    Re: Insert Character and Text within Cell that already contains a word

    Excellent! All of the formulas works except for NBVC (in fact A4, B4 don't match, but formula gives me AB LNEquity without the "/".

    Thanks Guys

  6. #6
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Insert Character and Text within Cell that already contains a word

    I guess I misinterpreted as you wanting to compare column A with Column B and see if matches exist... my mistake.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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.2.0