Largest Letter

suechetty

New Member
Joined
Jul 4, 2020
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Hello,
I would like a formula to say "OK" if Grade 1 is the highest grade compared to Grade 2 and Grade 3. What formula can I use please?
Also, is there a way I can use conditional formatting to highlight Grade 1 cell if it is the highest grade?

Thank you for the help.
Example
Grade 1Grade 2Grade 3
ABBOK
CBANO
 
Probably be a neater way, but how about

IF(LEN(G2)=1,IF(AND(CODE(G2)=MIN(CODE(G2:I2)),SUM(--ISNUMBER(FIND("*",H2:I2)))=0),"OK","No"),"OK")
I think this will also work...

=IF(OR(LEN(G2)>1,CODE(G2)<=MIN(CODE(H2),CODE(I2))),"OK","No")
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Probably be a neater way, but how about

+Fluff New.xlsm
GHIJ
1Grade 1Grade 2Grade 3
2BCBOK
3CDBNo
4CCCOK
5CCCOK
6BCCOK
7BA*ANo
8CBBNo
9CCCOK
10CCBNo
11BBBOK
12A*BAOK
13AA*CNo
Master
Cell Formulas
RangeFormula
J2:J13J2=IF(LEN(G2)=1,IF(AND(CODE(G2)=MIN(CODE(G2:I2)),SUM(--ISNUMBER(FIND("*",H2:I2)))=0),"OK","No"),"OK")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G2:G13Expression=J2="OK"textNO
Thank you, initially it didn't work for all the rows but that's because there are leading spaces before and after the grades as it's taken from different sources but I've added TRIM() in each of the G:I cells and the formula worked perfectly. Thank you once again. Saved me hours of manual check.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
You can consider the following.
This was prepared on Excel 2010; consequently, they require array enter CSE.

T10_1512a.xlsm
GHIJ
1Grade 1Grade 2Grade 3Grade 1 Highest
2ABCTRUE
3BACFALSE
4A*BCTRUE
5AA*CFALSE
6A*A*CTRUE
2d
Cell Formulas
RangeFormula
J2:J4J2=CODE(G2)<=(MIN(CODE(H2:I2))-IFERROR(FIND("*",H2:I2),0))
J5:J6J5=(CODE(G5)-LEN(G5))<=(MIN(CODE(H5:I5))-IFERROR(FIND("*",H5:I5),0))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
The OP wanted "OK" or "No" as the answers, but he was willing to accept TRUE and FALSE, the logical expression from my formula in Message #11 could be use...

=OR(LEN(G2)>1,CODE(G2)<=MIN(CODE(H2),CODE(I2)))

Note that this is not an array formula so it can be entered normally into the cell.
 
Upvote 0
Rick, with your formula I get a false +ve, on the last row of this data.
+Fluff New.xlsm
GHIJK
1Grade 1Grade 2Grade 3FluffRick
2BCBOKOK
3CDBNoNo
4CCCOKOK
5CCCOKOK
6BCCOKOK
7BA*ANoNo
8CBBNoNo
9CCCOKOK
10CCBNoNo
11BBBOKOK
12A*BAOKOK
13AA*CNoOK
Results
Cell Formulas
RangeFormula
J2:J13J2=IF(LEN(G2)=1,IF(AND(CODE(G2)=MIN(CODE(G2:I2)),SUM(--ISNUMBER(FIND("*",H2:I2)))=0),"OK","No"),"OK")
K2:K13K2=IF(OR(LEN(G2)>1,CODE(G2)<=MIN(CODE(H2),CODE(I2))),"OK","No")
 
Upvote 0
I thought I deleted the previous message.
I noticed a problem at the last minute.
You can consider the following. It was prepared with Excel 2010; consequently, the array formulas must be array entered.

T10_1512a.xlsm
GHIJ
1Grade 1Grade 2Grade 3Grade 1 Highest
2ABCTRUE
3BACFALSE
4A*BCTRUE
5AA*CFALSE
6A*A*CTRUE
7
2d
Cell Formulas
RangeFormula
J2:J6J2=(CODE(G2)-IF(LEN(G2)>1,1,0))<=MIN(CODE(H2:I2)-ISNUMBER((FIND("*",H2:I2))))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
As it happens that formula will need CSE entry in all versions, because if entered normally with dynamic arrays it will spill.
 
Upvote 0
Rick, with your formula I get a false +ve, on the last row of this data.
Good catch! Here is a fix (the formula is still normally-entered)...

=IF(OR(LEN(G2)>1,AND(MAX(LEN(H2),LEN(I2))<=LEN(G2),CODE(G2)<=MIN(CODE(H2),CODE(I2)))),"OK","No")

And if the OP is willing to accept TRUE or FALSE answer, this (still normally-entered)...

=OR(LEN(G2)>1,AND(MAX(LEN(H2),LEN(I2))<=LEN(G2),CODE(G2)<=MIN(CODE(H2),CODE(I2))))
 
Upvote 0
T10_1512a.xlsm
GHIJ
1Grade 1Grade 2Grade 3Grade 1 Highest
2ABCTRUE
3BACFALSE
4A*BCTRUE
5AA*CFALSE
6A*A*CTRUE
2d
Cell Formulas
RangeFormula
J2:J6J2=IF(SUMPRODUCT(--(LEN(G2:I2)=2)),(G2="A*"),CODE(G2)<=MIN(CODE(H2),CODE(I2)))
 
Upvote 0

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,078
Latest member
skydd

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top