Gradient fill conditional upon number of instances of specific text - excel

I'm trying to use a header row for conditional formatting that shows a gradient (stronger colour of red) depending on how many occurrences of text are in the cells in each column. For example, if there are two instances of text in the column below, the top header row cell will be a lighter shade of red. If there were 20 instances of text in the column below, the top header row cell would be a darker shade of red.
Does someone have a straight forward way of making this work? I suspect it will be based on a 'count if' formula but unclear on how best to go about what I suspect will be a very straightforward operation.

If prepared to add a formula in Row1 such as:
=COUNTIF(A2:A12,"a")
copied across to suit, then a Graded Color Scale should suit:
Here the relevant text has been chosen to be a.

Related

Excel - Program a specific cell to change colour based on specific condition of another cell's colours

I need some advice on how to set up a rule to change a specific cell's color that is based on multiple cells or column colors.
Example - cell A1 should change blue n color, should column B1:B15 contain a set number of colored orange and red cells.
What would the best approach for this type of rule configuration would you suggest?
Thanks in advance.
I would include a separate cell, say A2, which returns a 'TRUE' or 'FALSE' value based on the contents of B1:B15 (i.e. looking at their values and not colours to see if the criteria you're looking for has been met).
You can then link the conditional formatting rule for A1 to the contents of A2.

How to change the background of a cell in excel, by using a formula, no Conditional Formatting

I have a column with numbers 0 to 100 and I want to change the background colour of the next column according to those values
with 0 as red, and 100 as normal green
and as the number gets higher, the colour fades from red to light red, to white in 50 and then, light green to green in 100
The question is how do I do that, without using conditional formatting
I was trying to use ColourIndex, as
=Range("A1").Interior.ColorIndex = RGB(255,0,0)
but the function is not working, and I do not want to use conditional formatting
Any ideas?
If you don't want to use conditional formatting, your only other avenue is VBA. But this can easily be done with ONE SINGLE conditional format applied to the range of 100 cells.
If you want to format the column to the right of the original values, use a formula to pull the values from the column to the left, then apply a color scale conditional format to the target column.
Set a custom number format of ;;; to hide the numbers in the formatted column.
Answering your question as stated in your title (How to change the background of a cell in excel, by using a formula, no Conditional Formatting) - You can't. Not with a worksheet formula.

Autofill conditional formatting cell references

Excel conditional formatting fill down is working but not recording the correct formula once filled down.
eg. Cells in Column B (eg B6) have a value (active, exit, suspend). The adjacent Column C cell needs to be colored green if the adjacent value in column B shows the entry active. This works fine when using in C6 Use a formula to determine which cells to format, and Format values where this formula is true shows =B6="active" and cell C6 comes up filled with the green color.
Upon fill down from cell C6 the formatting is all displayed correctly for each additional instance of the word active in a column B cell. However when the conditional formatting rule is viewed for a cell such as C7, C8 onwards instead of showing =B7"active" or =B8="active" etc they still all say =B6="active".
Does anyone know why they do not refer to their relative adjacent cell (B7, B8, B9 etc) instead of the original B6? The formula originally was =$B$6="active" and has been edited to remove the absolute reference and replaced with =B6="active" to allow a relative fill down.
Does anyone know why they do not refer to their relative adjacent cell ( B7, B8, B9 etc ) instead of the original B6 ?
Presumably someone in Microsoft does and that is not the answer you seek.
However you acknowledge the formatting is working so it hardly seems to matter.
I can suggest that it is efficient. Conditional Formatting with a formula has three key parts:
Formula
Formatting
Range
Formula
May be complex and lengthy.
Formatting
It is what it has to be. Usually a very simple fill colour but sometimes bold, font, font colour etc.
Range
The 'neglected' one of the three but equally important though simple - just co-ordinates defining one or more rectangles (or a singe cell reference otherwise the top left and bottom right references). An efficient way to define an area that works whether one cell or one million, still just two corners at most.
You have probably noticed that whatever you enter there that is valid, anchors ($ signs) will be added where not already provided. You may also have noticed that Applies to will accept a named range - but Excel then automatically converts this to the cell reference/s.
It might help to consider what you would do if you were in charge of having doors painted yellow at house numbers 1 to 10 on a housing estate (yellow highlighting probably the most common format chosen for Conditional Formatting and a cell being roughly the shape of the surface of one side of a door). Say during the process you were required to extend that to house numbers 11 to 15 also. Would you then produce five additional copies of the painting specification (the formula), it might be several pages long, or would you merely change your instructions to the team doing the work from "do this for houses 1 to 10" to "do this for houses 1 to 15"?
As you copy down the Applies to range adjusts accordingly, the system works. But for each rule there is only one range and that is the case in reverse, for each range thee is only one rule, So no need to express that rule cell by cell, hence perhaps a million times over.

Highlighting cells in excel based on complex conditions

I am trying to do nested conditioned formatting.
Here is an example to explain: I have three tables, each of them is highlighted (green, or red) based on some condition. In each table, the red highlighting is specific to the rows "LASSO", while the green highlighting is for the row "Stepwise".
Now, I would like to highlight in blue the column names (VAL, EQ, EFF, SIZE, ..) if the cells in corresponding columns are highlighted in each table in both green and red.
Example: MOM is highlighted in the 3 tables, and is highlighted in every table in both green and red (i.e. for both LASSO and Stepwise). In this case, I want to highlight the the cells F2,F9 and F16 in blue.
Then, I would like to highlight in purple the column names (VAL, EQ, EFF, SIZE, ..) if the cells in corresponding columns are highlighted in each table in green OR red.
Example: UMP is highlighted in all tables, but not in green and red in every table (as you see, in table 1, it is only highlighted in red, not green). In this case, I want to highlight the cells K2,K9 and K16 in blue.
This is what I am looking for:
I apologize if the explanation is a bit confusing. I am ready to give further details/examples if needed.
Thank you,
Something along the following lines should suit:
applied to Row1 and then copied to rows 9 and 16 with Format Painter.
The actual components within the =AND will depend upon the trigger points for the existing green and red formatting.
Edit: Image for "applied to Row1":
It is however never a good idea to apply conditional formatting to more cells than really necessary (say ~ currently required + a reasonable margin for any future growth) because such formats are highly volatile.

Excel: Conditional formatting (colour scale), IF top of column matches a value

I'm a maths teacher and I'm storing my class data in an Excel spreadsheet. Each student occupies a row. Some columns relate to homework completion and they get a certain colour scale formatting. Other columns relate to test scores and they get a different colour scale formatting.
At the moment, when I add a new column for e.g. another homework exercise, I have to edit the rules manually, so the correct colour scale rule will apply to that particular column. This is quite fiddly and annoying.
I would like to make a single conditional formatting rule for the table that will apply a colour scale highlight to cells based on their values (e.g. red for 0, yellow for 0.5, green for 1), but ONLY if a cell at the TOP of that column matches a particular value.
To put it another way, I want my column headings to contain indicators for what kind of values go in the column, and I want Excel to apply different colour scale rules to each column based on the indicator at the top.
Is there a way to do this?
(My apologies if this is a duplicate question; I've searched but couldn't find something that connected conditional formatting based on a column header with a colour scale highlighting rule)
Excel's built-in colour scales don't take into account any other factors than the values in the range.
If you want to base the conditional formatting on a combination of factors, you will need to create several conditional formatting rules for the column. You can then copy and paste the format of that column to another column. You can adjust the specific parameters for that column by editing its rules.
Any more detailed advice can only be supplied if you provide a data sample.

Resources