Forum Discussion
Excel Conditional Formatting Challenge
I'm a high school teacher and have a spreadsheet to collect data from students test results.
The test occurs weekly and is out of 150.
If the score is higher than the students previous score, the cell turns green.
If the score if lower than the students previous score, the cell turns red.
If the score is the same as the students previous score, the cell turns yellow.
If the student is absent the score is represented as "a" and the cell turns white.
After a student returns from being absent, the cells color is always red regardless of their last score before they were absent.
Here is an example of the spreadsheet showing red after absent
Ideally, i would like it to ignore the "absent" and look at the cell before it OR give the "a" the same value as the cell before. such that the above table looks like this:
If this is possible, Please let me know!
Thanks.
Select C4 to the end of the data. C4 should be the active cell in the selection.
(We don't select column B since a score in column B does not have a predecessor)
On the home tab of the ribbon. select Conditional Formatting > New Rule...
Select 'Use a formula to determine which cell to format'.
Enter the formula
=AND(C4<>"",C4<>"a",C4>LOOKUP(1000,$B4:B4))
Click Format...
Activate the Fill tab.
Select green.
Click OK, then click OK again.
Repeat the above steps, but with the formula
=AND(C4<>"",C4<>"a",C4=LOOKUP(1000,$B4:B4))
and yellow as color.
Finally, repeat them again with
=AND(C4<>"",C4<>"a",C4<LOOKUP(1000,$B4:B4))
and red as color.
2 Replies
Select C4 to the end of the data. C4 should be the active cell in the selection.
(We don't select column B since a score in column B does not have a predecessor)
On the home tab of the ribbon. select Conditional Formatting > New Rule...
Select 'Use a formula to determine which cell to format'.
Enter the formula
=AND(C4<>"",C4<>"a",C4>LOOKUP(1000,$B4:B4))
Click Format...
Activate the Fill tab.
Select green.
Click OK, then click OK again.
Repeat the above steps, but with the formula
=AND(C4<>"",C4<>"a",C4=LOOKUP(1000,$B4:B4))
and yellow as color.
Finally, repeat them again with
=AND(C4<>"",C4<>"a",C4<LOOKUP(1000,$B4:B4))
and red as color.
- Atomic1890Copper Contributor
HansVogelaar
Cheers, worked perfectly 🙂