+ Reply to Thread
Results 1 to 3 of 3

Thread: Vlookup Question - how to ignore - or + in middle of a string

  1. #1
    Registered User
    Join Date
    01-10-2011
    Location
    Los Angeles
    MS-Off Ver
    Excel 2003
    Posts
    2

    Vlookup Question - how to ignore - or + in middle of a string

    Hi,

    I am using Vlookup to label Bonds as either Investment Grade or Junk. My Vlookup table is below.

    Some bond grades show up as

    BBB-*-

    The *- denotes a potential downgrade (or upgrade if is *+)

    The operator (- or +) before the *- seems to create a problem and the vlookup table can't process the first (- or +) or it throws an N/A. I think it reads the operator as a plus or minus, thinking it is trying to a math function. I have tried formatting the text on both the cell and the table but that doesn't work. Any ideas on how to ignore the + or - before a * if one exists? This is my first post so I apologize for any lack of ediquette.


    Here is the formula I am using for the
    =IF(ISNA(VLOOKUP(E26,S_P,3,FALSE)),"Not Rated",VLOOKUP(E26,S_P,3,FALSE))



    S_P table
    Col A Col B
    AAA Investment Grade
    AA+ Investment Grade
    AA Investment Grade
    AA- Investment Grade
    A+ Investment Grade
    A Investment Grade
    A- Investment Grade
    BBB+ Investment Grade
    BBB Investment Grade
    BBB- Investment Grade
    BB+ Junk
    BB Junk
    BB- Junk
    B+ Junk
    B Junk
    B- Junk
    CCC+ Junk
    CCC Junk
    CCC- Junk
    CC Junk
    D Junk

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: Vlookup Question - how to ignore - or + in middle of a string

    * in a VLOOKUP acts as a wildcard

    Perhaps you want:

    VLOOKUP(LEFT(E26,FIND("*",E26&"*")-1),S_P,3,FALSE)

  3. #3
    Registered User
    Join Date
    01-10-2011
    Location
    Los Angeles
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Vlookup Question - how to ignore - or + in middle of a string

    Quote Originally Posted by DonkeyOte View Post
    * in a VLOOKUP acts as a wildcard

    Perhaps you want:

    VLOOKUP(LEFT(E26,FIND("*",E26&"*")-1),S_P,3,FALSE)
    That seems to be exactly what I am looking for, thank you very much.

+ 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