+ Reply to Thread
Results 1 to 4 of 4

Excel 2007 : Help with IF and returning 1st character in a cell and returning text

  1. #1
    Registered User
    Join Date
    05-03-2012
    Location
    San Diego
    MS-Off Ver
    Excel 2007
    Posts
    3

    Help with IF and returning 1st character in a cell and returning text

    I'm trying to write a formula that scans a cell and returns:
    • "Foreclosure" if it contains an "H"
    • "Performing" if the 1st character is 0
    • "Subperforming" if the first character is 1 or 2
    • "Non-performing" if the first character is 3 or greater

    I have this so far (A1 Represents the 12 character cell to the left):
    =IF(COUNTIF(A1,"*H*")=1,"Foreclosure",IF(LEFT(A1,1)=0,"Performing",IF(0<LEFT(A1,1)<=2,"Subperforming",IF(LEFT(A1,1)>2,"Non-Performing"))))
    But it only returns "Non-performing" for every cell

    This is an example of what I want it to do:
    606000000000 --> Non-performing
    HH0000000000 --> Foreclosure
    000100000100 --> Performing
    543333333333 --> Non-Performing
    112222222333 --> Subperforming
    11000000H000 --> Foreclosure
    666666666666 --> Non-performing
    Last edited by petercom10; 05-03-2012 at 06:33 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Help with IF and returning 1st character in a cell and returning text

    Depends on order of importance... but
    Please Login or Register  to view this content.
    Where there is a will there are many ways.

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

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

  3. #3
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Help with IF and returning 1st character in a cell and returning text

    The other way I can think of is to write a custom function using VBA

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Contributor tkowal's Avatar
    Join Date
    11-20-2010
    Location
    Miami, Fl
    MS-Off Ver
    Excel 2010
    Posts
    150

    Re: Help with IF and returning 1st character in a cell and returning text

    Or this:

    =IF(ISERROR(FIND("H",T(A1))>1)=FALSE, "Foreclosure",IF(LEFT(A1,1)= "0", "Performing",IF(VALUE(LEFT(A1,1))< 3,"Subperforming","Non-Performing")))
    Ted
    "Live Long and Prosper"

+ 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