# if statement ends with

1. ## 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. ## Re: if statement ends with

Try:

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

3. ## 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. ## 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. ## Re: if statement ends with

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

6. ## 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.

7. ## 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. ## Re: if statement ends with

Originally Posted by thongtran
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. ## 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. ## Re: if statement ends with

Originally Posted by wellybob
... 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. ## Re: if statement ends with

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

12. ## 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!

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

#### 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