How to apply background color formatting - colors

I am trying to figure out how to apply background color based on a cell >5 to be orange in a column titled value. I currently have a template in google sheets with the following to format the column which works fine but I cannot figure out the background coloring (column 12 is titled value)
tbody>tr>:nth-child(2){
color:red;
width:200px;
text-align:center;
}
Thanks in advance

Related

In excel, what is the code to apply colors to a cell based on text in another cell?

I don’t want to use conditional formatting because I need a different value as the text in the cell (not what the color values apply to).
Column E is status (at risk/on track/needs improvement)
Column I is trend, displayed as arrows (Unicode text)
Column J is blank
I would like the color of the corresponding cells to be based on Column E text “Needs Improvement” in red, “At Risk” in yellow, and “On Track” in green.
So - in J2 through J13, I need the color only from the E2:E13 status and the trend arrows from I2:I13
I know this has been asked before in one way or another, but I can’t figure out the conditional formatting in VBA for some reason. Im sorry
Conditional formatting doesn’t work, I was trying to pull conditional colors from column E, but the only code I could get to work couldn’t integrate conditional formatting colors (it had to be true cell colors)
Below are the 4 sets of conditional formatting I used to accomplish the below example. I did not know what your trend data looks like so you'll need to adjust that to fit. To note, the formula in column J is ["=I" & row], so it's pulling over the same values. Those are hidden with the icon formatting. ::
Where RG = range("J2:J18")
Colour:="Red" while [=$E2="At Risk"]
Colour:="Yellow" while [=$E2="Needs Improvement"]
Colour:="Green" while [=$E2="On Track"]
Shape:="Icon Set" [checkmark] Show Icon Only
Example of formatting:
Example of result:
Let me know if any of that doesn't make sense.

Change background or fill color of a cell in pandastable

I am using pandastable to display a pandas dataframe. I would like to set the fill color or the background color of a cell based on the value. Is there a function I can call which takes row index, column index and color? BTW, when I right click on a cell in a displayed table, it gives me a menu to select a color, but it does not set the color of the cell. How is the selected color used?
Thank you.

Conditional formatting with cell values based on their row

I'm currently doing a small side project where I'm converting images into excel spreadsheets. I have a python program which turns each cell into a range between 0 and 255 (RGB color codes).
I had made this a while back and don't actually remember how I colored each row with conditional formatting.
Essentially, I need to select each row, turn it a shade of red. Then I need to select each alternate row (MOD 2 = 0) and turn each of those into a shade of green. Finally, I need to select each third row (MOD 3 = 0) and turn those into a shade of blue.
Again, to reiterate, I'm having trouble with actually selecting the rows. Is there any way I can do this (without doing it by hand)?
Check the following:
Highlight rows to get formatted
Click on "Conditional Formatting" and then "New Rule"
Click the last option on the upper part of the box "Use a formula to determine which cells to format"
Type this =MOD(ROW(),1)=0
Click "Format" and select a fill color (Red in this example)
Repeat it two more time for the other two colors
=MOD(ROW(),2)=0 for Green & =MOD(ROW(),3)=0 for Blue
check the below image

Xlsx Writer Critera If Blank

Given this format:
format0 = workbook.add_format({'bg_color': 'none'})
I'd like to apply it (no background color) if the cell is blank.
Here's what I've tried so far:
worksheet.conditional_format('B2:B14',
{'type':'cell',
'criteria': '=isblank()=True',
'format': format0
})
But I keep getting this error:
KeyError: 'value'
I'm pretty sure I'm not using a correct entry for 'criteria', but I'm not sure how to do it.
Thanks in advance!
One solution:
It appears that setting the color to 'none' produces blue cells, for some reason. So instead, I opted to color blank cells white:
format0 = workbook.add_format({'bg_color': 'white'})
Then, by reading the documentation (what a great idea!):
worksheet.conditional_format('B2:B14', {'type':'blanks', 'format': format0})
I put this before other conditional formats for the same column.
The border of the blank cells are not visible if you use white background color as given in the answer above.It can be modified to
format0 = workbook.add_format({'bg_color':'white','border':1,'border_color':'#D5DBDB'})to give a border to the blank cells that looks similar to default excel cells.

Excel 2010: Conditional Format Class Schedule based on Subject name

Excel 2010, creating a class schedule. Colour coded per class name.
I have a table, broken in to 10 min amounts.
7 wide, 30 down.
I want to conditionally format all cells that contain the letters ENG in green, all SCI in yellow & so on.
Currently my table colours end up with the top priority cell, rather than end up with a multi-coloured table.
In conditional formatting:
=$R$12="ENG"
=$R$11:$V$20,$R$25:$V$29,$R$34:$V$38 colour = Green
=$R$17="SCI"
=$R$11:$V$20,$R$25:$V$29,$R$34:$V$38 colour = Purple
I either get 'green' or 'purple', I don't get a table with both colours in their respective cells.
R12 = Green
R17 = Purple
U12 = Cyan (eventually) etc etc
I know I'm missing something, I don't know what though.
Thank you
Use relative references in your conditional formulas:
If the highlighted cell in your currently selected range is R12, edit the formula (with mouse and Backspace/Delete buttons, do not press arrow keys when editing the formula) to:
=R12="ENG"
...
(see also Excel vocabulary to find solutions faster for a little more background)
Also you don't have to use a formula for this use case, just choose an option Format only cells that contain > change bettween drop box to equal to > write ENG to the text box.

Resources