Search code examples
typescriptgoogle-apps-scriptgoogle-sheetsgoogle-sheets-formulagoogle-sheets-query

Highlight the row of the data after ticking the checkbox but with colors that varies from what type the data is under


Good day!

I would like for some help on figuring out a formula, or script code that would highlight the row beside the checkbox after ticking it, but with highlight colors that varies between types of data it is under.

Currently, I am using this formula in google sheets : ( =$G2=TRUE )

After ticking the checkbox, it does highlight the row beside it, but I want the highlight color to be different depending on the type of data it is under. What I want is for the highlight color to change to blue, if it's "Animations", red if it's "Music Videos" and "Videos"to remain the same color.

I have attached a link to a screenshot below. enter image description here

And here is the link for the sheet for your reference. https://docs.google.com/spreadsheets/d/1e7nrU2F8E-iiUPsOaRd_VnSkwEfAlfmQoRLDpAQfPZE/edit?usp=sharing

If you guys can help me out, it would really be a big help.

Thank you in Advance.

Cheers!


Solution

  • You can put more AND(...) and put more conditional rules to check multiple out come with more different colors

    =AND($G2=TRUE,$A2="Videos") for green
    
    =AND($G2=TRUE,$A2="Music Videos") for red
    
    =AND($G2=TRUE,$A2="Animations") for blue