Solved

Evaluating last character of a string with IF function

Posted on 2010-09-13
4
307 Views
Last Modified: 2012-08-13
I am sure that there is a way to do this but it is not clear to me how...

I am using an IF statement. I would like the logical_test parameter to evaluate a strings last character.

EXAMPLE:

=IF(A1 end with a "T","String 1","String 2")
0
Comment
Question by:greentatertot1970
4 Comments
 
LVL 13

Accepted Solution

by:
MWGainesJR earned 250 total points
ID: 33662524
=IF(right(A1,1)="T","String 1","String 2")
0
 
LVL 18

Assisted Solution

by:Cluskitt
Cluskitt earned 250 total points
ID: 33662534
=IF(RIGHT(A1,1)="T","String 1",String 2")
0
 
LVL 24

Expert Comment

by:broomee9
ID: 33662618
In case there are any extraneous spaces add the end of your string, you may want to use the Trim function to remove them, and then compare the actual last character:

=IF(RIGHT(TRIM(A1),1)="T","String 1","String 2")
0
 

Author Closing Comment

by:greentatertot1970
ID: 33662678
Perfect - thank you both!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now