Excel 2010: Conditional Format Class Schedule based on Subject name - excel

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.

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.

Excel autofill a column with 76000+ rows not working

I want to create a column to print a different text based on the cell color of another cell. So for example, A1 color is green, and A2 is red. So I want B1 and B2 to be "new" and "old", respectively.
My approach is to first create a function to get the color using the below function:
Function ColorIndex(CellColor As Range)
ColorIndex = CellColor.Interior.ColorIndex
End Function
Using `=ColorIndex(A1)', this works great because for it prints a 4 and for red it prints a 3. I can intern use IF to print "old" and "new".
I run into an issue when I try to auto fill the rest of the column with the same formula. Basically I want to use =ColorIndex() for all 76000 rows in column B. I tried double clicking the drag handle and manually selecting Fill, but nothing happened. Any one know why this is happening and is there a way to get around it?

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

Why change color or bold in part of one cell is not working anymore?

In Excel, it was posible change the font color in part of a cell.
I've tried the below code. It's not working in updated Excel 365 for value (not formula),
Set ce=cells(5,3)
ce.Characters(1, 5).Font.Color = vbBlue
It should change the color in 5 first characters in the cell, but it changes the color of all cell content. Even interactively it's not working. One select a piece inside a cell, press a color. When exits the cell, it colours all the cell content (in the same way of VBA code)
Why?
Update: It's my fault. One just can colour part of a text not a number. With text, both VBA or not works OK
After the discussion in comments, Excel accept partial color cell to text content, but not for number content.
So put ABCDEFG in a active cell. The below code colour the 5 first characters in red. Interactivally it also works.
ActiveCell.Characters(1, 5).Font.Color = vbRed
Now put 1234567 in a active cell. The below code paint all in red. Interactivally the color remains the same before.
ActiveCell.NumberFormat = "#" // Even if you format as text doesn't work
ActiveCell.Characters(1, 5).Font.Color = vbRed
The same code works if you just put a B before 1234567 ...

Customize Conditional Formatting in Excel 2010

I'm unable to create a rule in Conditional Formatting for this requirement. I was tried using this option "Use a formula to determine which cells to format" inside the rule but didnt get proper formulae.
My Requirement:
If I change the Activity value to Completed in column A then accordingly the font color should be in (Sky blue) and font size is (10) in columns B and C.
If I change the activity value to Delayed in column A then the font color should be in (Red) and font size is (Default or no change) in columns B and C.
Also if I manually type to change the Activity type from To Do to Completed then the Final Date column field value should be automatically filled with the current or Today's date which is as on date.
What formulae I can use for this requirement? How?
Changing the text format is easy to solve with Conditional Formatting, changing the cell's text to today's date requires VBA.
1. Text format
Select cells B2:C10
Create a conditional format with "Use a formula to determine which cells to format". Enter this formula:
=$A2="Completed"
Click the 'Format' button and apply the blue text color and your desired font size.
Repeat the steps using this formula:
=$A2="Delayed"
Apply the red font color.
2. Enter today's date via VBA
Open the VBA editor with Alt+F11
Double click the worksheet on the left hand panel where your Activity table is placed (i.e. Sheet1).
Enter this code in the right hand code panel:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Value2 = "Completed" Then
Cells(Target.Row, 3).Value = Date
End If
End Sub

Resources