compare two cells with non-numeric data

  • Thread starter Thread starter jef
  • Start date Start date
J

jef

I need to compare two cells (A1 vs B1) that contain letter grades
(that is, A, A-, B+, B, B-, etc.) I need to show if one cell (B1) has
a higher grade than the cell to which it is being compared to (A1), is
the same or has a lower grade.

If this were the comparison of number data, then no problem.

Any help would be appreciated. Thanks
 
One thing you could do is to allocate a nominal value to each grade.
For example, set up a column somewhere, eg in X1:X10 like this:

A
A-
B+
B
B-
C+
C
C-
D
E

I don't know what grades you are actually using, but I'm sure you can
see the idea of listing them in rank order. There is an implied value
for each entry in this column (i.e. the row that the grade is on).
Then with appropriate grades in A1 and B1 you can put this formula in
C1:

=IF(MATCH(A1,X$1:X$10,0)=MATCH(B1,X$1:X$10,0),"equal",IF(MATCH(A1,X$1:X
$10,0)>MATCH(B1,X$1:X$10,0),"B is greater","A is greater"))

Copy it down as far as you need to.

Hope this helps.

Pete
 
Back
Top