Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Greater than for non-numerical values

Status
Not open for further replies.

SaintAugustine

Technical User
Aug 29, 2001
53
0
0
US
Howdy folks,

I've got a big list of values, which unfortunately aren't numbers - they're letters (let's pretend it's letter grades: A-F). There are two columns: Last Year and This Year. I want to write a formula to see if the values have increased or decreased. =TRUE would work great, but it doesn't work on non-numbers. Is there a way to this function what my heirarchy is so that it will work on text?

(I could replace the letters with numbers, but unfortunately I have 19 values - that's a lot of search & replacing).
 
I'd make a VLOOKUP.

Create yourself a table on another sheet:

Column A Column B
A............100
B.............90
C.............80
and so on.

Then, select the cells in that table and insert-name-define and call it GradeValues or something.

Then, you can do a formula like this:

=if(vlookup(A1,GradeValues,2)>(vlookup(A2,GradeValues,2),"True","False")

or something like that. Anne Troy
 
If the initial letters are all unique (or if the codes are 1-character long) you can use the CODE function which gives the ASCII value of the first (or only) letter in a string. But this is over-kill...

You should be able to use &quot;>&quot; or &quot;<&quot; on text strings just as well as numbers. In other words, if cell A1 contains the letter &quot;A&quot; and cell A2 contains the letter &quot;B&quot; then the formula =A2>A1 gives TRUE and the formula =A2<A1 gives FALSE.

What are the actual values you are trying to compare?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top