Conditional Formatting with Multiple Criteria

faris99

New Member
Joined
Dec 1, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hello MrExcel community,

I'm working with a database comprised of answers to a test given by students and am trying to conditionally format them such that correct answers are highlighted green and incorrect and blank entries are highlighted red. The database is structured with columns for each question and rows corresponding to each individual students answer. The actual correct answers are indicated below each corresponding column. It is important to note that each column may have two correct answers.

I have successfully created formatting rules for correct answers and blank entries, however, my attempts for formatting incorrect entries have failed so far. When applying a rule where only one of the correct answers is used as the condition, the incorrect cells are highlighted as intended (below). However, when I try to create a condition checking for either correct answer A or B, the entire selection of cells turns red.

Below is an excerpt from the database (highlighted cells = student answers, final 2 cells = correct answers).

MATRIXERROR.PNG


Currently I am using this formatting rule (where S32 and S33 are the correct answers):
=S3:S29<>S$32

I applied the following rule to include both correct answers:
=S3:S29<>(OR(S$32,S$33))

This did not work. I also tried to create two separate rules in the first style but to no avail. Moreover, using a NOT-OR statement did not work either.

Could someone please provide a solution and explain whether I've conceptualised the problem wrong? Any help is much appreciated!
 

Some videos you may like

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
53,139
Office Version
  1. 365
Platform
  1. Windows
How about
Excel Formula:
=AND(S3<>S$32,S3<>S$33)
 

faris99

New Member
Joined
Dec 1, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
How about
Excel Formula:
=AND(S3<>S$32,S3<>S$33)
Thanks for the quick reply Fluff but that did not work either. All cells except the blank one are now highlighted green.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
53,139
Office Version
  1. 365
Platform
  1. Windows
Not for me
+Fluff v2.xlsm
S
1
2
3B3
4C1
5B3
6
7C1
8B3
9C1
10B3
11B3
12C1
13C1
14B3
15C1
16C1
17B3
18C1
19B3
20B3
21C4
22B3
23B3
24C1
25B4
26A2
27B4
28B3
29C1
30
31
32C1
33B3
34
Helper
Cells with Conditional Formatting
CellConditionCell FormatStop If True
S3:S29Expression=AND(S3<>S$32,S3<>S$33)textNO
 
Solution

faris99

New Member
Joined
Dec 1, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Fluff thank you for the help! I'll go through and restart the formatting. Positive I can get it to work.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
53,139
Office Version
  1. 365
Platform
  1. Windows
Ok, any problems just post back.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,980
Messages
5,599,160
Members
414,295
Latest member
Dolenhil

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
Top