ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   comparing two values (https://www.excelbanter.com/excel-worksheet-functions/15593-comparing-two-values.html)

Jerry

comparing two values
 
I have two columns: Col1: A and Col2: C, some values may be Col1: C and Col2:
A or some other ones may be Col1: A and Col2: A. Values range from A to F.
What I want to display is: if Col2 is less than Col1 display "Dropped", if
col2 is greater than col1 display "Improved", if col1 and col2 are the same
display "No change". Your assistance is greatly appreciated. Jerry

Jerry

It does work good. Now I have a question, why when the values are C+ to a C-
it replies improved instead of Dropped. As you can see this is for school
grades. Thanks for the prompt answer.

"Maglor" wrote:

Jerry wrote:
I have two columns: Col1: A and Col2: C, some values may be Col1: C and Col2:
A or some other ones may be Col1: A and Col2: A. Values range from A to F.
What I want to display is: if Col2 is less than Col1 display "Dropped", if
col2 is greater than col1 display "Improved", if col1 and col2 are the same
display "No change". Your assistance is greatly appreciated. Jerry


If I understand your question correctly (the column explanation seems a
little bit confusing, my bad :-) ), this should solve your problem:

=IF(col1=col2,"no change",IF(col1col2,"dropped","improved"))

Of course you'll need to replace Col1 and Col2 by the corresponding
cells of each column.


JulieD

Hi Jerry

AFAIK there's no way excel can the sort of comparison you're asking it to
without you providing excel with some sort of grading scale, so in an unused
part of your workbook in column A enter the different grades in descending
order (i'm assuming you're doing this on sheet 2 from cell A2 to A10)

then you can use the following formula

=IF(MATCH(A1,Sheet2!$A$2:$A$10,0)=MATCH(B1,Sheet2! $A$2:$A$10,0),"no
change",IF(MATCH(A1,Sheet2!$A$2:$A$10,0)<MATCH(B1, Sheet2!$A$2:$A$10,0),"dropped",
"improved"))

where A1 and B1 are the student's results.

Cheers
JulieD



"Jerry" wrote in message
...
It does work good. Now I have a question, why when the values are C+ to a
C-
it replies improved instead of Dropped. As you can see this is for school
grades. Thanks for the prompt answer.

"Maglor" wrote:

Jerry wrote:
I have two columns: Col1: A and Col2: C, some values may be Col1: C and
Col2:
A or some other ones may be Col1: A and Col2: A. Values range from A to
F.
What I want to display is: if Col2 is less than Col1 display "Dropped",
if
col2 is greater than col1 display "Improved", if col1 and col2 are the
same
display "No change". Your assistance is greatly appreciated. Jerry


If I understand your question correctly (the column explanation seems a
little bit confusing, my bad :-) ), this should solve your problem:

=IF(col1=col2,"no change",IF(col1col2,"dropped","improved"))

Of course you'll need to replace Col1 and Col2 by the corresponding
cells of each column.





All times are GMT +1. The time now is 02:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com