+ Reply to Thread
Results 1 to 12 of 12

if statement ends with

  1. #1
    Registered User
    Join Date
    09-08-2005
    Posts
    7

    if statement ends with

    Is it possible to do a if cell A1 ends with R then say R Parts?
    Example cell A1 have 12345R, I would like my if statement to check cell A1 if it end with R then say R Parts. Thanks

  2. #2
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Rowley
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: if statement ends with

    Try:

    =IF(RIGHT(A1,1)="R","R-Parts","")

  3. #3
    Registered User
    Join Date
    09-08-2005
    Posts
    7

    Re: if statement ends with

    Wow xenixman, thank you very much it work! you just saved me from being fired
    How about multiple ends with, like ends with R = R Parts, ends with B = B Parts ?

  4. #4
    Registered User
    Join Date
    09-08-2005
    Posts
    7

    Re: if statement ends with

    I got it! thanks again X.
    =IF(RIGHT(A5,1)="R","R-Parts",IF(RIGHT(A5,1)="B","Base Parts","what"))

  5. #5
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Rowley
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: if statement ends with

    Just be aware that you can not nest more than 7 IF's

  6. #6
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: if statement ends with

    Just be aware that you can not nest more than 7 IF's
    Only true if the OP is not using Excel 2007, which his/her profile doesn't state. Hint: please complete your profile to at least tell us which version you are using.

    If you need to nest more than three (or four max, IMO), then you should consider using a matrix table to perform a look up and match.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  7. #7
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: if statement ends with

    Xenixman, just an FYI: If you're only looking up the last letter, ",1" isn't necessary in the formula.

  8. #8
    Registered User
    Join Date
    11-15-2013
    Location
    Egypt,ElBehaira,Kafreldawar
    MS-Off Ver
    Excel 2010
    Posts
    1

    Thumbs up Re: if statement ends with

    Quote Originally Posted by thongtran View Post
    I got it! thanks again X.
    =IF(RIGHT(A5,1)="R","R-Parts",IF(RIGHT(A5,1)="B","Base Parts","what"))
    perfect, i have tried it and it works, thank you

  9. #9
    Registered User
    Join Date
    01-20-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: if statement ends with

    Up to 64 IF functions can be nested as value_if_true and value_if_false arguments to construct more elaborate tests - this is in 2010

  10. #10
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: if statement ends with

    Quote Originally Posted by wellybob View Post
    ... this is in 2010
    And it was true for XL2007.

    However, this thread was started in 2009, so I don't think any of the original contributors are still checking it.

    Pete

  11. #11
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: if statement ends with

    You could shorten the formula by using a lookup table, depends how many parts there are.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  12. #12
    Forum Contributor
    Join Date
    11-12-2014
    Location
    Boston, MA
    MS-Off Ver
    Office 2010
    Posts
    172

    Re: if statement ends with

    Or:
    Column A: Part Name
    Column B: "=Right(A2)" *Thanks @Darkyam! I never knew that you didn't need the ",1"
    Column C: "=CONCATENATE(B2," Part")

    No need for nesting IF's!

+ 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