Excel Recoding
Excel Recoding
• IF function
IF with only one condition
• Grades file
• Find out if a student passed/failed based on percentage
• Note that the closed brackets must equal the open brackets
Q1. Assign all grades, along with “fail” for those with marks below 50.
Solution
=IF(AND(T2>=50, T2<70), "D",IF(AND(T2>=70,T2<80), "C", IF(AND(T2>=80, T2<90), "B", IF(T2>=90, "A", IF(T2<50, "Fail")))))
Sol2.
=IF(AA2="A",1, IF(AA2 = "B",2, IF(AA2 = "C",3, IF(AA2 = "D",4, IF(AA2 = "Fail",5)))))
Sol3.
=IF(OR(AA2="A", AA2 = "B"), "Merit", IF(OR(AA2="C", AA2="D"),"pass without merit", AA2))