Excel: colour the lowest time value in range - excel

I have an excel file with times in column D, F and H. I want to color the cell with the lowest time.
I have tried several things from the Conditional Formatting but it does not work.
Any suggestions how to solve this?

What you want to do cannot be done with the built-in simple formats. You need to create a rule that uses a formula.
Before you do that, select the range in the worksheet. Then click New Rule > Use a formula to determine. In the screenshot that is the range from C3 to H5.
In the formula box, use a formula like this
=C3=MIN($C$3:$H$5)
Important!! The reference to C3 is relative to the current cell. There are no $ signs in that reference, so each cell in the range will be evaluated individually. You should use the cell at the top left of your selection. The range reference inside the MIN() function is absolute, using $ signs.
If you want to highlight the smallest value in each column, you need to create separate rules, one for each column.

Related

Graph formula references error

I am trying to create a graph with the help of Name Manage. I have come up with the following formula to create the series of numbers required by me. The formula is:
Sheet2!B4:INDIRECT(ADDRESS(4,Sheet3!AM11,4,,"Sheet2"))
When I input this formula into the cell it works properly and provide me with required series, but when I create the name(using name manager) of the series with the same formula and try the create the graph the excel throws the following error:
Several things:
thing one: you are using relative cell references in the named formula. That means that wherever the active cell is, the named formula will recalculate based on the current cell. B4 will change to any cell based on the current cell. Use absolute references like $B$4if you want to anchor a certain cell as a base reference.
Thing two: Indirect with a complicated nesting of functions that reveal a row and/or column can be replaced by a more efficient Index formula.
Thing one is probably the thing that causes your problems, because the result of the formula will change with the selected cell.
Edit after inspecting the workbook
The problem is definitely the relative cell references, and making them absolute definitely solves the problem. Your formula was defined with the active cell in B10 and it is
=Sheet1!B1:INDIRECT(ADDRESS(1,Sheet1!D10,4))
But when the active cell is in A1, for example, the formula changes to
=Sheet1!A1048568:INDIRECT(ADDRESS(1,Sheet1!C1,4))
Every time you click on a cell, the named formula will recalculate based on the position of the current cell. That's why you need absolute references. You can correct your formula to
=Sheet1!$B$1:INDIRECT(ADDRESS(1,Sheet1!$D$10,4))
Or you can use Index instead of Indirect this way:
=Sheet1!$B$1:INDEX(Sheet1!$1:$1,Sheet1!$D$10)
Or you can use a simple Offset function
=OFFSET(Sheet1!$B$1,0,0,1,Sheet1!$D$10-1)
Whichever formula you prefer, this will always deliver the correct range, no matter which cell is the active cell.
Once you have the date range in place, you can use a simple offset from the date range to get the series ranges.
Offset by one row for Open, offset by two rows for High, etc.
=OFFSET(Date,1,0)
The screenshot shows the Date formula with the Offset function and you can see the formulas used for the Open, High, Low, and AdjClose names. The chart shows the series Open and AdjClose. Note how the marching ants highlight the current extent of the named range. The Date name will always refer to a range starting in B1 because that cell is anchored with an absolute reference.
If you have any questions about that, pipe up.

Conditional formatting many cells by individual formulae

I want to apply a conditional formatting (CF) rule to a group of cells to individually colour them if their individual cell values are greater than a threshold (in this case >=5). To illustrate:
The top row shows how I want the bottom row to look. For the bottom row I cannot figure out how correctly format according to cell-specific formulae.
The problem is identifying a way to specify cell-specific CF formulas in a single operation for a group of cells - as you can by pasting/dragging normal cell formulas. I obviously don't want to have to manually specify the formula for each cell!
Grateful for assistance.
Select the rows or columns or range that you want to conditional format,
Enter the below formula in the formula bar in conditional format and choose a fill color,
=AND(A1>=5,ISNUMBER(A1))
If you are starting in row3, change the A1 to A3. The $ that you have in the formula makes it absolute. It should be relative.
You just select all required cells to format. Then go to conditional formatting.
Check what is the cell shown just before the formula bar (the single cell that represents the selected range, also called default cell) and use that cell in your formula without absolute reference. like B3>=5 or R3>=5

Conditional formatting based on reference cell value for each cell in row

I would like to color cells in each row based on the value of a cell in the same row and then do the next one.
How do you set the formula to be able to color the cell if not equal to a reference cell on the same row?
So I just want to change the color of a different cell than reference cell which will have a different value for each row.
In Excel you will need to create a formatting rule, within the modal select the option that you want to use a formula to decide what cells to format:
Within the edit box you can type the formula that is used. The formula in the example will check whether the value of the 1 cell in the column is not empty. If this is true, the cell will be formatted as specified in the format preview.
Mainly using the ROW and COLUMN functions in Excel you can get access to the current Row and Column of the Cell for which the formula is executed.
Given the input:
Select Cells B2:G6 and click on Conditional Formatting
Your prompt will look different on Windows, but the important part is "Use a formula to determine which cells to format" The formula is =B2<>$A2 Please note the lack of $ because it needs to be flexible (except for the reference cell column which in my case is A)
Final result is:
Conditional formatting foes not need to operate on the cell you are formatting. Using a mixture of $ and non-$ formatted formulas, you can set highlighting accordingly.
Note to make sure this works correctly, highlight the area to be formatted first, and note where you start. e.g. If I wanted this to apply to A2:A50, then I would highlight A2 first, and make the formula reference row 2.
Also, note that you will have to type in the formula. Any clicking of cells will automatically put in $ signs to fix the comparison to that specific location, which is not the behavior we desire
e.g. To format A2:K50, when the H value in that column is 7
Highlight A2:K50
Conditional Formatting -> New Rule -> Use a formula
formula would be =($H2=7) <- this will fix the column to be H, and vary the row accordingly
Format as desired
e.g.2. To format based on previous cell
Highlight A2:A50
Conditional Formatting -> New Rule -> Use a formula
formula would be =(A2<>A1) <- this will check the row above each time
Format as desired

Conditional formatting based on a value determined in each row in Excel for indeterminate amount of rows

So I've got a cell that I'd like to colour orange if the date in that cell (lets say that cell is C1) is later than a date in a cell (lets say B1) somewhere on that same row. I can conditional format C1 to do this. All good. But then I'd like to create an indeterminate amount of rows like this. The two dates which I want to compare are in the same column in every row, but are compared per row. So one date in C1 will compare to B1. Another in C2 will compare to B2. There doesn't seem to be a conditional formatting technique to achieve this. Help?
P.s: A few things I've tried is using If statements but I can't seem to work out how to do it. I've also tried conditionally formatting one row and then using "insert" to replicate the condition formatting of the row above it but this seems to start comparing the inserted row to the date in the row above...
In order to apply conditional formatting to a range you can select the range first (and then that range will automatically become the "applies to" range in conditional formatting)
....then set the formula that applies to the first row of that range only
....then select appropriate formatting
As long as the formula uses the correct relative references that's sufficient to make it work for the entire range
So in your specific case you can select the whole column, or a specific range like C1:C100 and then apply the formula that you need for the first row of that range, i.e.
=C1>B1
Another way to achieve this is to apply the formula to the first row only (as you have done already) then click on "format painter" (the little brush on the Home ribbon)......then select the range to copy to (e.g. C2:C100)

How to determine current row?

I am using Conditional Formatting to try and change the colour of a cell in column A if the text in Column B is certain values. Currently my three formula's are this:
=$B$2="Low"
=$B$2="Good"
=$B$2="High"
I need a way to quickly push this to all 50 columns therefore I thought if I could change the formula to the following it would work I just don't know how:
=$B$ThisCellsRow()="Low"
=$B$ThisCellsRow()="Good"
=$B$ThisCellsRow()="High"
You're using absolute cell references (the $ in the address), which prevents Excel from adjusting the address as you add/remove rows and move the formula around. If you use $B2 instead, as you drag down the formula, Excel can adjust it to be $B3, $B4, $B5 and so on. With this format, the B column remains constant, and the row portion is flexible.

Resources