I am trying to highlight cells that fall outside the expected value range (higher or lower only). Each row corresponds to a different row that has two cells with a max and min. Is there a way to make Excel figure that out?
For example Row 7's cells should only highlight if they value is outside the min of B31 or max B32. And Row 18 should be governed by Row 42.
I have used conditional formatting. But I want to apply the same logic to all the cells and rows instead of doing them one by one.
Scott Craner's suggestion is spot on. You can use a formula inside of your conditional formatting by following the instructions below:
Select Cell B4 (Sodium baseline test results)
Click "Conditional Formatting" in the Ribbon, "Highlight Cells Rules", and then "Less Than"
In the dialog that pops up, enter the following formula:
=VLOOKUP(A4,$A$27:$C$48,2,FALSE)
Click OK to save and apply the conditional format.
Click the B4 Cell again, and select the bottom right corner (you should see a little box sort of that you can click and drag).
RIGHT CLICK AND DRAG (not left click/drag) that bottom corner so that all the cells get selected. Then when the dialog box pops up, select "Fill Formatting Only". This will apply the formula to all the cells, and the lookup conditions automatically update based on the test name in the same row.
Repeat the above for the Greater Than rules, but modify the lookup formula as follows so that it looks up the MAX (3rd) Column:
=VLOOKUP(A4,$A$27:$C$48,3,FALSE)
If this answer was useful or helpful, please mark or indicate as such, thank you!
Related
In the table below you will see values so you can easily understand what I am asking for!
Can anybody help me with this thing because I have to do it for thousand of rows and I do it manually until now.
Your quickly help and answers are appreciated.
1.Select the cells you want to check if you need to highlight
2. click Home > Conditional Formatting > New Rule
3. Click on Use a formula to determine which cells to format
4. Under Format values where this formula is true, type the formula: =A2=B2
5. Click on "Format"
6. Click on "Fill" and choose the color you want to highlight (yellow?)
That's it
I'd like to create a rule that writes "100%" in column A whenever I write "end" in column B.
So it would be something like this:
[] X
100% end
[] Y
The brackets represent an empty cell.
I've tried:
IF(B1:B3="end",100%,"")
but I would like to leave the cells on column A empty, with no data or formulas, if the respective cell in column B doesn't contain "end".
So I've thought about adding a new rule with conditional formatting but it's not working. Any solutions?
Can be achieved with CF but rather nastily. You would need to fill ColumnA first, say with 1s - but can be hidden by (standard) formatting the text to match the background colour (ie usually white).
Then clear any CF from and select ColumnA, HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=B1="end"
Format..., select Black (probably) font and Custom Number format of:
00%
OK, OK.
If your blank cells must remain blank in reality rather than appearance then CF alone is not a solution for you.
Edit:
You can get a value to show in a cell based on the value of another cell, without having anything* in the cell, and without VBA:
*kinda
Using cells I2:J9 as an example, the steps are:
Click I2, then Ctrl+1 to open the Format Cells dialog.
On the Number tab, click Custom, then in the Type box enter: ;;; and click OK.
Hit Alt+O+D+N to add new Conditional Format and choose Use a formula to determine which
cells to format.
In the Format values where... box, enter: =J2="end" (If Excel adds $'s, remove them), then click Format...
On the Number tab, click Custom, then in the Type box enter: ;;;"100%" . (Optionally set a color, font, etc.) then hit ENTER 3 times to return to the
worksheet.
Click I2, hit your SPACEBAR once and then hit ENTER. (* Fine, I
confess: the cell isn't totally empty.)
Click I2 and hit Ctrl+C to Copy.
Select I2:J9 and press Alt+E+S+T then hit
ENTER to Paste Formats.
Now when you type end into any of J2:J9, the corresponding cell in column I will display 100%.
You can also repeat this process to add additional conditions to the same cells if needed.
Original Answer: (Alternative Solutions)
Sometimes I get stuck spending too much time on a question about a very minor issue. This is one of those times. :)
Thinking further about your question, I suspect you might not have meant you need the "cells on column A empty, with no data or formulas", but perhaps you mean you want the cells to "appear empty".
Example:
These cells do appear empty, unless you to click on the cell and then look at the formula bar:
...but the formula bar can be hidden too:
I need your assistance with Excel. I have the following columns on my worksheet
EmployeeNumber, EmployeeName, SalesID,Email, EmployeeNumberID.
The EmployeeNumber and EmployeeNumberID columns are the key columns as these contain the employee number. The problem is that EmployeeNumber contains all employees from different departments and EmployeeNumberID contains employee from the Sales department.
Could you please assist with highlighting the EmployeeNumber that are not in the EmployeeNumberID column, if we could highlight the entire row that would be great.
Mnay Thanks
Assuming your data is layed out as per the image below, select the range from A2 to E9 and ensure that the upper left cell A2 is your active cell. Notice in the image the active cell has a light background compared to the grey background of the rest of the selected range.
Then go to your HOME ribbon and select conditional formatting.
From the drop down menu that appears select New Rule.
In the New Formatting Rule window that appears select "Use a formula to determine which cells to format" at the bottom of the list. Then click to format button and chose whatever formatting you want to have applied. I would recommend the Fill tab and then select a colour.
Enter the following logical check in the "Format values where this formula is true:" box:
=COUNTIF($E$2:$E$9,$A2)=0
It will count the number of times Employee number in column A occurs in Column E. It will then check to see if that count is zero meaning its not in column or not part of the sales team, and apply the formatting you selected early to all cells in the row from A to E. If you only want to colour cells in column A then select A2:A9 as your initial selection area for applying conditional formatting to. The equation should not need to change.
Proof of Concept
You just need some conditional formatting. Select the area you want to apply the highlighting to, lets say A:E, then use conditional formatting with the following formula:
=ISNA(MATCH($A1,$E:$E,0))
assuming EmployeeNumber is in column A and EmployeeNumberID is in column E.
What this does is tries to match the EmployeeNumber to a value in column E. If it fails, then it will return #N/A and ISNA will return TRUE and the row will be highlighted.
Note that $A1 should be the top left cell in the range you are formatting. If you start lower, adjust the cell accordingly.
I want to change the color of a cell if it is an outlier in its row, and apply this to all cells in the spreadsheet. Defining an outlier as a value two standard deviations away from the mean (of the row). How could I do this?
Sample Data
Formula I have so far:
=$C$9>(N9+2*$O$9)
This is your formula for you conditional formatting:
=OR(C9>($N9+2*$O9),C9<($N9-2*$O9))
Now you will need to properly apply it to the entire range. In order to do this, follow these steps:
Select the top left corner of your data and drag to the bottom right corner. This should leave the area in a grey zone with the top left cell being a white background and also known as the active cell.
Select conditional formatting from the ribbon and use the formula to determine as you have in your screen shot.
Enter the formula above in the formula bar. Note has the row numbers are not locked in all cases and only the column are locked with $ for column N and O. The formula will adjust itself as it moves through the selected range and away from the active cell which you enter the formula on.
Set up any formatting you want applied when the value of a cell is more than 2 std away from the mean.
Proof of Concept
I need a formula that will generate a flag. Basically Column A would have a specific date. I need the next column to generate a flag if the current date is 45 days after the original (A).
I'm not sure how to type in the formula.
I think what you want to utilize is an if statement with the TODAY() function.
Here's an example of how to accomplish what you're looking for. I added some conditional formatting to help color code the result.
I would suggest that you use conditional formatting to get this result.
Highlight the cell (or range of cells) that you want to be flagged if the trigger point is hit and click "Conditional formatting" -> "New Rule".
From the new window that opened, select the bottom option that should be "Use a formula to determine which cells to format".
In the box in the bottom half of the "New Formatting Rule" window, type the following:
=(Today()-A1)>45
Note: A1 should be the first cell in the range you selected to check (the dates) and 45 is the number of days from today you want to be the flag.
Then click the "Format" button to apply what ever kind of flag you want.
In the above example, the cell will be filled red and text will be set to white. This would be a good conditional formatting rule to apply to the actual date range so that the date itself is flagged.