0

So I'm making this attendance tracker for my school, and I need to apply a different format depending on the value of the cell and if a checkbox is ticked or not. Here is a screenshot of the different values to be applied and the checkboxes:

Conditional Format range

The different values dictate:

  • 1= 1 hour class, student attended
  • 0= 1/2 hour class, student didn't attend
  • J= Student has a justified absence
  • 1-0= 2 hour class, student only attended for 1 hour
  • 1-1= 2 hour class, student attended both hours

It is important for the values to represent if it's a 2 hour or a 1 hour class, so maybe using an operator is not the best choice but it was the one that occurred to me. (If you happen to have a better arrangement I'm all ears).

So the main point is: I need each of the cells to check the Checkbox for the column to verify if that class has been given by the teacher, and then check the value inside of the cell to change its format and apply a color to the cell.(eg. Green for attendance, red for absence, blue for justified, etc.).

I've been struggling with this for a while and apologies if the explanation is long as heck.

Edit: Here is an example document with the desired results. Example document

2
  • 1
    Welcome to Web Applications Stack Exchange. It is unclear whether you need this in Microsoft Excel or Google Sheets — the answer is likely to differ between the two. Consider sharing a publicly editable sample spreadsheet with realistic-looking data, and showing your hand-entered expected results there. Commented May 14, 2021 at 14:11
  • Thanks. It is on Google sheets. I've added the link to the example document as you said.
    – Mike Ortiz
    Commented May 14, 2021 at 15:56

2 Answers 2

0

You will need several rules in your quest.

Right from the start you will need to reset the Fill colour for all of your cells.
Remember that ALL these rules are applied on the same range, which is D4:AB

enter image description here

1st rule
Create the grey base for your students using =$C4<>""

The rest of the rules all have in common the conditions that are applied when the cell in row 3 is TRUE

2nd kind of rules
This is for when a cell within the range is a number
=AND(D4=0,D4<>"",D$3=TRUE) and =AND(D4=1,D4<>"",D$3=TRUE)

3rd kind of rules
This is for when a cell within the range is text
=AND(D4="1-0",D4<>"",D$3=TRUE) and =AND(D4="J",D4<>"",D$3=TRUE)

4th kind of rules
This is for when a cell within the range is a date
Now you will say: But I have no dates in my range
No you don't. But if you take a closer look in your cells containing 1-1, you will notice that Google mistakes them for the date 1/1/2021. So to capture those cells we use
=AND(ISDATE(D4),D4<>"",D$3=TRUE)

Now you are all set.
Enjoy :)

3
  • Welcome. Please remember that as per site guidelines when an answer addresses your question, you should accept it and even upvote it so others can benefit as well. Commented May 14, 2021 at 18:13
  • You also mention in your posted question "another point is that I have to make another formula that .... on the classes given." This is a completely different issue. You should edit your question, delete this part and post a new question with just it. Commented May 14, 2021 at 18:14
  • Oh, that part wasn't for an answer. It's just in case someone suggested to delete the checkboxes. In my main document I already have that part set up. I'll delete it anyways just in case. Thanks!
    – Mike Ortiz
    Commented May 14, 2021 at 19:08
0

Use conditional formatting rules like Text ends with 0 to set the fill colors.

See the new Solution sheet in your sample spreadsheet.

1
  • Wow. This solution was simpler than I expected. Thanks!
    – Mike Ortiz
    Commented May 14, 2021 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.