excel conditional formatting with data - excel

I am trying to format different columns of my excel sheet based on two conditions:
if the cell does not contain the letter "u" or the letter "r" and if it is greater than a set number.
For example, if I have a column of data, I would want 0.3 highlighted because it is greater than the set number of 0.00834 and does not contain U or R. I don't want 0.0071U to be highlighted or 0.0056J.
Any help?

Select the cells/column(s) you want the conditional format applied
to (for this example I assume you use column B:B)
Check which cell is active - the "white" cell in the blue selection. (I assume it's B1)
Create a new conditional format Home -> Conditional formatting -> New Rule
Select "Use a formula to determine which cells to format"
Enter the following formula: =AND(RIGHT(B1,1)<>"U",RIGHT(B1,1)<>"R",IF(ISNUMBER(B1),B1,VALUE(LEFT(B1,LEN(B1)-1)))>0.00834) Make sure that the B1 is your active cell from step 2. Also make sure that it is not using any $ to fix row or column.Note: The formula assumes that your cells contain either proper numbers - or number and a single letter at the end!
Set the format you wish in the Format dialog.
Done!

Related

How can I represent different status' through colour coding?

I want to change the colours of cells in a specific column when I enter "Y" in one of 3 other columns.
example: when I enter a "Y" in B3 the cell A3 turns red.
There is more, I want to create a whole table that has three columns each representing a form of communication. When a person requests to be contacted I can put a "Y" in one of the columns depending on the communication type.
When I put a "Y" in one of the three columns the cell in column A of the corresponding row turns red.
example: when a "Y" in one of any of the cells from B3-B33; C3-C33; D3-D33 the cells in for corresponding row from the A column turns red.
example: when a "Y" is placed in B30, A30 turns red; when a "Y" is placed in C7, A7 turns Red; If a "Y" is entered into D16, A16 turns red etc.
Then, I want the cell in the A column to turn yellow when an "X" is placed into the corresponding E column on the same row this is represented by the person have being contacted.
Then, I want the cell in column A to turn green, when the and "X" is place into the F column of the corresponding cell in Column A on the same row. This represents that the person has responded and dealt with.
I have tried work out excel code to make these conditions work but I am struggling. Any suggestions?
You can use conditional formatting in this order:
First apply conditional formatting for Column F (check mark on "Stop if True")
Second apply conditional formatting for Column E (check mark on "Stop if True")
Third Apply conditional formatting for Column B,C & D
To add conditional formatting, follow these step:
Go to Home tab > Conditional formatting > New Rule
Select: Use a formula to determine which cells to format
Input the formula shown in image
Format the fill color per your requirement
Click on Apply
To apply to the column A, you need to change applies to range using:
Conditional Formatting > Manage Rules > Select the rule and change
range address depending on your data size.
Please see this image:
The third condition is as under:
Have you tried to use conditional formatting? you can start off by doing a simple case.
In order to have multiple cases apply to the same cell you can access the conditional formatting rules manager from the conditional formatting menu.
From there you can add additional rules for a cell.
For the formula itself i'd advise choosing: use a formula to determine which cells to format.
When the formula returns "true" the formatting will be used, so then you can make it search for all the row range you mentioned for the character you decide, you will need 1 rule for each color/character.
once you have done the formatting for one row you can drag it to apply it to all the rows if i remember correctly.

Conditional Formatting for Blank Cell Does not Give Expected Result

I am trying to format a cell, the goal is to have a Green Fill if the adjacent cell (on left) is blank and Red Fill if not blank. Below is the Code applied to Column D
="ISBlank(($C$2)"
and a snapshot below target cell
I am not getting the Desired result, the cells in column D remain white (excel default format of cells)
Please see the Data I am using below
I don't think you need the $ before the 2 in =ISBLANK($C$2) otherwisethe conditional formatting will only refer to C2. I think you'll want:
=ISBLANK($C2)
Also if the contents in column C is ="" , ISBLANK will return FALSE, assuming you don't want that behavior, you could try:
=LEN($C2)>0
Which checks how long the text is in C2.
Example:
Occasionally I've also had trouble getting is blank() to work properly. What I would try is:
$d$2 = ""
1] Do way with the double inverted commas
2] The Applies to range must be more than a single cell if you want the CF to apply across a range of more than one cell
3] You don't need two rules
Select ColumnD and 'standard' fill red. (Remove fill from D1 if preferred). Select ColumnD (this sets the Applies to range) and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=ISBLANK(C1)
Format..., select green Fill, OK, OK.
You do not need to lock the column reference because you are only applying the CF to a single column. You must not lock the row reference if to apply to multiple rows on a row by row basis.
With the above if a cell is red and has an apparently empty cell on its left then that cell is not actually empty.

EXCEL Custom Format

I have column A that contains Phone Numbers.
I have column B that contains the text Incoming or Outgoing.
I need to highlight column B where it contains Incoming Only if the number in column A is equal to a specific number.
You need to use conditional formatting with a formula to determine which cells to highlight.
So you will highlight all of column B, and select conditional formatting from the Home tab. Then click new rule.
You want to select the rule type as Use a formula to determine which cells to format.
You want to use the rule =AND($A2 = 1, $B2 = "Incoming"), you can change what A2 is equal to, and this will highlight the cells in col B that matches a number in A2 and is equal to 'Incoming`
Assuming you want Column F formatted depending on what is in the cells in Column E on a row by row basis,
then select Column F and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=AND(E1="111-111-1111",F1="INCOMING")
Format..., select choice of formatting, OK, OK.
Adjust the telephone number to suit.
By selecting Column F to start with what you have set, applies to a range of Column F, hence need to start with Row 1. Since dealing with a single column there is no need for the anchors ($).

Change colour on row in one sheet if same value exists in second sheet

I have a sheet named Skruvdragare where cells B1-B500 contain serial numbers like: 123456789, 987654321 etc and a second sheet Låda 1 in which I will also put in some serial numbers (not necessarily the same numbers as in the Skruvdragare sheet).
If I put in a serial number, anywhere in Låda 1, which exists in Skruvdragare I want the row for this serial number to turn to red background and white text in the Skruvdragare sheet.
Use Conditional Formatting for this. But, as I've learned right now, the formula must not contain references to other sheets...so we work around this limitation by putting the formula into an auxiliary column in sheet2:
=NOT(ISERROR(MATCH($A1,sheet1!$A$1:$A$500,0)))
and the conditional format just contains the formula
=$D1
if the aux column was "D". Copy that format to as many cells you like (except for the aux column!).
Please Define Name of Workbook Scope for Låda 1, say OtherSheet:
Select the cell, range of cells, or nonadjacent selections that you want to name.
Click the Name box at the left end of the formula bar.
Name box
Type the name that you want to use to refer to your selection. Names can be up to 255 characters in length.
Press ENTER.
Select from Row1 to Row500 in Skruvdragare and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=COUNTIF(OtherSheet,$B1)
Format..., select red fill white font, OK, OK.

Excel 2010 - Conditional formatting, color adjacent cells in same row

Is is possible in Excel 2010 to set a conditional formatting rule to highlight all not empty cells in a row when the cell in particular column has a particular value?
I have a report in which every row identify a day. I would like to colour in grey the rows relative to Saturday and Sunday. The day is stored in column C.
I know how to highlight cells in column C, but how can I easily extent the format of cell C to the adjacent not empty cells in the same row?
This is easy to do without a macro and without using INDIRECT function
Assuming you have data starting at row 2 and that the "day" in column C is a text value then do this:
Select whole range of data, e.g. A2:J100
apply in conditional formatting the formula that needs to apply to the first row, e.g.
=AND($C2="Saturday",A2<>"")
That will apply formatting to all cells in the range if col C of that row is "Saturday" and the cell itself is not blank. Note C2 needs a $ in front because it applies to C for the whole row A2 doesn't need $
If you want to apply to Saturday and Sunday the same type of formatting then use an OR, i.e.
=AND(OR($C2="Saturday",$C2="Sunday"),A2<>"")
....or if the column C entries are actual dates make that
=AND(WEEKDAY($C2,2)>5,$C2<>"",A2<>"")
See example workbook with that last CF formula demonstrated
Taking inspiration from John answer in this thread, I've used the "indirect" function on the conditional formatting.
Select Conditional Formatting
Select New Rule
Select "Use a Formula to determine which cells to format"
Enter the Formula, =WEEKDAY(INDIRECT("c"&ROW()))=1 # for Sundays
Enter the Format you want (text color, fill color, etc).
Select OK to save the new format
Open "Manage Rules" in Conditional Formatting
Select "This Worksheet" if you can't see your new rule.
In the "Applies to" box of your new rule, enter =$A$1:$J$35 (or however wide/long you want the conditional formatting to extend depending on your worksheet)
Do it again, this time inserting the Formula, =WEEKDAY(INDIRECT("c"&ROW()))=7 # for Saturdays
There is only an issue with this formula. When the cell in Column C is empty it will be read as 7, therefore the row will be formatted as if it's a Saturday. Do you know why?

Resources