+ Reply to Thread
Results 1 to 3 of 3

Find and replace as formula in Excel 2010

  1. #1
    Registered User
    Join Date
    10-07-2012
    Location
    dubai
    MS-Off Ver
    Excel 2010
    Posts
    2

    Find and replace as formula in Excel 2010

    Hi everybody.
    I am forex and options trader. Options contracts look like this: 'GOOG 121005C770" or "GOOG 121005P770". I need to have a formula that can lookup the cell and if contains "*******P***" to replace the whole cell with "Put" and if the cell contains "*******C***" to replace the whole cell with "Call". Now I am using find and replace function which is fine. I am using wildcard to find: ******P*** and replace it with Put and then run find and replace again to find: *******C*** and replace it with Call.
    Is there a way to have a simple formula which can do both seaches and replacements.
    thanks in advance.
    E. M.

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

    Re: Find and replace as formula in Excel 2010

    try
    =IF(ISNUMBER(SEARCH("c",RIGHT(A1,10))),"call",IF(ISNUMBER(SEARCH("p",RIGHT(A1,10))),"put",A1))
    "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

  3. #3
    Registered User
    Join Date
    10-07-2012
    Location
    dubai
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Find and replace as formula in Excel 2010

    Quote Originally Posted by martindwilson View Post
    try
    =IF(ISNUMBER(SEARCH("c",RIGHT(A1,10))),"call",IF(ISNUMBER(SEARCH("p",RIGHT(A1,10))),"put",A1))

    Great Martin.. that exactly gives the result I am looking for.

    Thanks a ton for your help.
    E. M.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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