If Condition with Conditional Formating

Navi_G

Board Regular
Joined
May 30, 2018
Messages
94
Office Version
  1. 2016
Platform
  1. Windows
Dear Experts,

I need a if formula that solve my problem with conditional Formatting.
Like, School scores grading on below Illustration</SPAN>:
i) less then 33% Grade Result F and showing in red
ii) 34% to 40% Grade Result E and showing in yellow
iii) 40% to 50% Grade Result D and showing in Green
iii) 50% to 60% Grade Result C and showing in Blue
iv) 60% to 70% Grade Result B and showing in Orange
v) 70% to 80 % Grade Result A and showing in Orange
vi) 80% to 100 % Grade Result A+ and showing in orange.

I need a formula for result (A+, A, B, C, D, E, F) and (color of condition formatting).

Regards
Navi_G:eeek:
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
You would create a CF rule for each color.
Assuming the percent is in A2.

for red
Code:
=A2<=33%

for Yellow
Code:
=AND(A2>=34%,A2<=39%)

Green
Code:
=AND(A2>=40%,A2<=49%)

Blue
Code:
=AND(A2>=50%,A2<=59%)

Orange
Code:
=AND(A2>=60%,A2<=100%)

To get the letter grade
Code:
=IF(A2<=33%,"F",IF(AND(A2>=34%,A2<=39%),"E",IF(AND(A2>=40%,A2<=49%),"D",IF(AND(A2>=50%,A2<=59%),"C",IF(AND(A2>=60%,A2<=69%),"B",IF(AND(A2>=70%,A2<=79%),"A","A+"))))))
 
Last edited:
Upvote 0
Thanks for your expert opinion.

i) if fomula is problem solved.
ii) But we need C.Formatting on Grade Column (A+, A, B, C, D, E, F) with using percentage column.

Thanks for your reply.
 
Upvote 0
Please help me on conditional formatting for Grades......
 
Upvote 0
Hi,

You'll need 5 separate CF rules, one for each color.

Select the range in Column F, and add CF rules using formula, use my formulas in H2:L2, one at a time.


Book1
BCDEFGHIJKL
1StudentsObtained ScoreTotal ScorePercentage %GradeOrangeBlueGreenYellowRed
2Student_1850120070.83%ATRUEFALSEFALSEFALSEFALSE
3Student_2950120079.17%A
4Student_31140120095.00%A+
5Student_4330120027.50%F
6Student_5451120037.58%E
7Student_6669120055.75%C
8Student_7776120064.67%B
9Student_8267120022.25%F
10Student_9981120081.75%A+
11Student_10532120044.33%D
12Student_11572120047.67%D
13Student_12981120081.75%A+
14Student_13401120033.42%E
15Student_14235120019.58%F
Sheet77
Cell Formulas
RangeFormula
H2=OR(F2="A+",F2="A",F2="B")
I2=F2="C"
J2=F2="D"
K2=F2="E"
L2=F2="F"
 
Upvote 0
Hi,

You'll need 5 separate CF rules, one for each color.

Select the range in Column F, and add CF rules using formula, use my formulas in H2:L2, one at a time.

BCDEFGHIJKL
StudentsObtained ScoreTotal ScorePercentage %GradeOrangeBlueGreenYellowRed
Student_1A
Student_2A
Student_3A+
Student_4F
Student_5E
Student_6C
Student_7B
Student_8F
Student_9A+
Student_10D
Student_11D
Student_12A+
Student_13E
Student_14F

<COLGROUP><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL></COLGROUP><THEAD>
</THEAD><TBODY>
[TD="align: center"]1[/TD]

[TD="align: right"][/TD]

[TD="align: center"]2[/TD]

[TD="align: right"]850[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]70.83%[/TD]

[TD="align: right"][/TD]
[TD="align: right"]TRUE[/TD]
[TD="align: right"]FALSE[/TD]
[TD="align: right"]FALSE[/TD]
[TD="align: right"]FALSE[/TD]
[TD="align: right"]FALSE[/TD]

[TD="align: center"]3[/TD]

[TD="align: right"]950[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]79.17%[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]

[TD="align: right"]1140[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]95.00%[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]5[/TD]

[TD="align: right"]330[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]27.50%[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]6[/TD]

[TD="align: right"]451[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]37.58%[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]7[/TD]

[TD="align: right"]669[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]55.75%[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]8[/TD]

[TD="align: right"]776[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]64.67%[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]9[/TD]

[TD="align: right"]267[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]22.25%[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]10[/TD]

[TD="align: right"]981[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]81.75%[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]11[/TD]

[TD="align: right"]532[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]44.33%[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]12[/TD]

[TD="align: right"]572[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]47.67%[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]13[/TD]

[TD="align: right"]981[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]81.75%[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]14[/TD]

[TD="align: right"]401[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]33.42%[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]15[/TD]

[TD="align: right"]235[/TD]
[TD="align: right"]1200[/TD]
[TD="align: right"]19.58%[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</TBODY>
Sheet77

[TABLE="width: 85%"]
<TBODY>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<THEAD>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</THEAD><TBODY>[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]H2[/TH]
[TD="align: left"]=OR(F2="A+",F2="A",F2="B")[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]I2[/TH]
[TD="align: left"]=F2="C"[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]J2[/TH]
[TD="align: left"]=F2="D"[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]K2[/TH]
[TD="align: left"]=F2="E"[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]L2[/TH]
[TD="align: left"]=F2="F"[/TD]
[/TR]
</TBODY>[/TABLE]
[/TD]
[/TR]
</TBODY>[/TABLE]

Hi,

Thanks for your response i work your expert opinion but only Orange color cover all cells and
but other colors not working please check and confirm what problem in this illustration.

My steps please review where is problem?

i) I enter formulas in range (H2:L2) and headings as well as (Orange,Blue,Green,Yellow,Red) in range (H1:L1).
ii) I select F2 and go to C.Formatting and use formula and select H2 and Format Orange.
iii) Next i select F2 and Repeat previous with range I2 and Color Blue and other as well as.
iv) but Orange color is working on all Grades others.

Please Review the Steps thanks for guidence

Thanks & Regards
Navi_G:confused:
 
Upvote 0
No, you don't need to add H2:L2 nor H1:L1, I have it in my sample Only to illustrate the logic and also to show the formulas.

Select F2 (or select ENTIRE data range in F Column), then go to Conditional Formatting, choose "Use formula....", enter the formula for Orange, click Format, choose your color (Orange), click OK, OK.
Repeat, Select F2, go to CF, use formula..., enter the formula for Blue, click Format, choose Blue, OK, OK.
Repeat for Green, Yellow, Red...

Let me know if you got it to work.
 
Upvote 0
Cross posted https://www.excelforum.com/excel-ge...a-with-conditional-formating.html#post4912289

Cross-Posting
While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0
Cross posted https://www.excelforum.com/excel-ge...a-with-conditional-formating.html#post4912289

Cross-Posting
While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.

Thanks For guidence.
Next time i avoide...

Navi_G
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,021
Members
452,374
Latest member
keccles

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