+ Reply to Thread
Results 1 to 3 of 3

Problem with the 'IF' function

  1. #1
    Registered User
    Join Date
    12-12-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Problem with the 'IF' function

    Hi,

    I need help using the IF function. I want to use it to analyze cells which all have values of the form: LetterLetterNumberNumberNumberNumber, where the first letter is either Y or N, the second letter is always an M and the numbers are random. For example YM0001 or NM1249 or YM0342, you get the idea.

    I want to use the IF function to return 'apple' if the first letter is Y and 'banana' if the first letter is N.

    Do you know how I can do this with 'IF' or if there is another more suitable function?

    Thanks,
    Bob
    Last edited by bobmcbob; 12-12-2011 at 10:41 PM.

  2. #2
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Problem with the 'IF' function

    Hello
    Welcome to the forum...
    How about

    =IF(LEFT(A18,1)="Y","apple",IF(LEFT(A18,1)="N","banana","not available"))
    or
    =IF(LEFT(A18,1)="Y","apple","banana")

    A18 is your number YM1234
    Last edited by vlady; 12-12-2011 at 10:37 PM. Reason: forgot to include cell ref
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  3. #3
    Registered User
    Join Date
    12-12-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Problem with the 'IF' function

    They both do the job well, and the first is even better for when the cell is blank. Thanks a lot for your rapid and helpful reply.

+ 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