Highlight rows based on several conditions But instead of the whole table, you select a column or a range where you want to highlight rows and use the formulas described above.įor example, we could create three such rules to shade only the cells in the " Order number" column based on another cell value (values in the Delivery column). In fact, this is simply a variation of changing the background color of a row case. How to change a cell's color based on a value of another cell In this case, the row will only be highlighted if the specified text is found in the first position in the cell.įor this conditional formatting rule to work correctly, make sure there are no leading spaces in the key column, otherwise you might rack your brain trying to figure out why the formula does not work :) You can use this free tool to find and remove leading and trailing spaces in your worksheets - Trim Spaces add-in for Excel. To change the row color when the key cell starts with a particular value, use =1 in the formula, e.g.: For example, the Delivery column (F) may contain the text " Urgent, Due in 6 Hours", and this row will be colored as well. Using >0 in the above formula means that the row will be colored no matter where the specified text is located in the key cell. Highlight row if cell starts with specific text In the formula, E2 is the address of the cell that you want to base your formatting on, the dollar sign ($) is used to lock the column coordinate, and >0 means that the formatting will be applied if the specified text (" Due in" in our case) is found in any position in the cell.Ĭreate three such rules following the steps from the first example, and you will have the below table, as the result: In this case, you'd better use the SEARCH function that works for the partial match as well: As you see, different orders are due in 1, 3, 5 or more days and the above formula won't work because it is purposed for exact match. While the formula from our first example could work for "Delivered" and "Past Due"( =$E2="Delivered" and =$E2="Past Due"), the task sounds a bit trickier for "Due in…" orders. Naturally, the row color will change if the order status gets updated.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |