In this tutorial, we will continue exploring the fascinating world of Excel Conditional Formatting. If you do not feel very comfortable in this area, you may want to look through the previous article first to revive the basics - How to use conditional formatting in Excel.
Today are going to dwell on how to use Excel formulas to format individual cells and entire rows based on the values you specify or based on another cell's value. This is often considered advanced aerobatics of Excel conditional formatting and once mastered, it will help you push the formats in your spreadsheets far beyond their common uses.
Excel conditional formatting based on another cell value
Excel's predefined conditional formatting, such as Data Bars, Color Scales and Icon Sets, are mainly purposed to format cells based on their own values. If you want to apply conditional formatting based on another cell or format an entire row based on a single cell's value, then you will need to use formulas.
So, let's see how you can make a rule using a formula and after discuss formula examples for specific tasks.
How to create a conditional formatting rule based on formula
To set up a conditional formatting rule based on a formula in any version of Excel 2010 through Excel 365, carry out these steps:
- Select the cells you want to format. You can select one column, several columns or the entire table if you want to apply your conditional format to rows.
Tip. If you plan to add more data in the future and you want the conditional formatting rule to get applied to new entries automatically, you can either:
- Convert a range of cells to a table (Insert tab > Table). In this case, the conditional formatting will be automatically applied to all new rows.
- Select some empty rows below your data, say 100 blank rows.
- On the Home tab, in the Styles group, click Conditional formatting > New Rule…
- In the New Formatting Rule window, select Use a formula to determine which cells to format.
- Enter the formula in the corresponding box.
- Click the Format… button to choose your custom format.
- Switch between the Font, Border and Fill tabs and play with different options such as font style, pattern color and fill effects to set up the format that works best for you. If the standard palette does not suffice, click More colors… and choose any RGB or HSL color to your liking. When done, click the OK button.
- Make sure the Preview section displays the format you want and if it does, click the OK button to save the rule. If you are not quite happy with the format preview, click the Format… button again and make the edits.
Tip. Whenever you need to edit a conditional formatting formula, press F2 and then move to the needed place within the formula using the arrow keys. If you try arrowing without pressing F2, a range will be inserted into the formula rather than just moving the insertion pointer. To add a certain cell reference to the formula, press F2 a second time and then click that cell.
Excel conditional formatting formula examples
Now that you know how to create and apply Excel conditional formatting based on another cell, let's move on and see how to use various Excel formulas in practice.
Tip. For your Excel conditional formatting formula to work correctly, please always follow these simple rules.
Formulas to compare values (numbers and text)
As you know Microsoft Excel provides a handful of ready-to-use rules to format cells with values greater than, less than or equal to the value you specify (Conditional Formatting >Highlight Cells Rules). However, these rules do not work if you want to conditionally format certain columns or entire rows based on a cell's value in another column. In this case, you use analogous formulas:
Condition | Formula example |
---|---|
Equal to | =$B2=10 |
Not equal to | =$B2<>10 |
Greater than | =$B2>10 |
Greater than or equal to | =$B2>=10 |
Less than | =$B2<10 |
Less than or equal to | =$B2<=10 |
Between | =AND($B2>5, $B2<10) |
The screenshot below shows an example of the Greater than formula that highlights product names in column A if the number of items in stock (column C) is greater than 0. Please pay attention that the formula applies to column A only ($A$2:$A$8). But if you select the whole table (in our case, $A$2:$E$8), this will highlight entire rows based on the value in column C.
In a similar fashion, you can create a conditional formatting rule to compare values of two cells. For example:
=$A2<$B2
- format cells or rows if a value in column A is less than the corresponding value in column B.
=$A2=$B2
- format cells or rows if values in columns A and B are the same.
=$A2<>$B2
- format cells or rows if a value in column A is not the same as in column B.
As you can see in the screenshot below, these formulas work for text values as well as for numbers.
AND and OR formulas
If you want to format your Excel table based on 2 or more conditions, then use either =AND or =OR function:
Condition | Formula | Description |
---|---|---|
If both conditions are met | =AND($B2<$C2, $C2<$D2) |
Formats cells if the value in column B is less than in column C, and if the value in column C is less than in column D. |
If one of the conditions is met | =OR($B2<$C2, $C2<$D2) |
Formats cells if the value in column B is less than in column C, or if the value in column C is less than in column D. |
In the screenshot below, we use the formula =AND($C2>0, $D2="Worldwide")
to change the background color of rows if the number of items in stock (Column C) is greater than 0 and if the product ships worldwide (Column D). Please pay attention that the formula works with text values as well as with numbers.
Naturally, you can use two, three or more conditions in your AND and OR formulas. To see how this works in practice, watch Video: Conditional formatting based on another cell.
These are the basic conditional formatting formulas you use in Excel. Now let's consider a bit more complex but far more interesting examples.
Conditional formatting for empty and non-empty cells
I think everyone knows how to format empty and not empty cells in Excel - you simply create a new rule of the "Format only cells that contain" type and choose either Blanks or No Blanks.
But what if you want to format cells in a certain column if a corresponding cell in another column is empty or not empty? In this case, you will need to utilize Excel formulas again:
Formula for blanks: =$B2=""
- format selected cells / rows if a corresponding cell in Column B is blank.
Formula for non-blanks: =$B2<>""
- format selected cells / rows if a corresponding cell in Column B is not blank.
Note. The formulas above will work for cells that are "visually" empty or not empty. If you use some Excel function that returns an empty string, e.g. =if(false,"OK", "")
, and you don't want such cells to be treated as blanks, use the following formulas instead =isblank(A1)=true
or =isblank(A1)=false
to format blank and non-blank cells, respectively.
And here is an example of how you can use the above formulas in practice. Suppose, you have a column (B) which is "Date of Sale" and another column (C) "Delivery". These 2 columns have a value only if a sale has been made and the item delivered. So, you want the entire row to turn orange when you've made a sale; and when an item is delivered, a corresponding row should turn green. To achieve this, you need to create 2 conditional formatting rules with the following formulas:
- Orange rows (a cell in column B is not empty):
=$B2<>""
- Green rows (cells in column B and column C are not empty):
=AND($B2<>"", $C2<>"")
One more thing for you to do is to move the second rule to the top and select the Stop if true check box next to this rule:
In this particular case, the "Stop if true" option is actually superfluous, and the rule will work with or without it. You may want to check this box just as an extra precaution, in case you add a few other rules in the future that may conflict with any of the existing ones.
For more information, please see Excel conditional formatting for blank cells.
Excel formulas to work with text values
If you want to format a certain column(s) when another cell in the same row contains a certain word, you can use a formula discussed in one of the previous examples (like =$D2="Worldwide"). However, this will only work for exact match.
For partial match, you will need to use either SEARCH (case insensitive) or FIND (case sensitive).
For example, to format selected cells or rows if a corresponding cell in column D contains the word "Worldwide", use the below formula. This formula will find all such cells, regardless of where the specified text is located in a cell, including "Ships Worldwide", "Worldwide, except for…", etc:
=SEARCH("Worldwide", $D2)>0
If you'd like to shade selected cells or rows if the cell's content starts with the search text, use this one:
=SEARCH("Worldwide", $D2)>1
Excel formulas to highlight duplicates
If your task is to conditionally format cells with duplicate values, you can go with the pre-defined rule available under Conditional formatting > Highlight Cells Rules > Duplicate Values… The following article provides a detailed guidance on how to use this feature: How to automatically highlight duplicates in Excel.
However, in some cases the data looks better if you color selected columns or entire rows when a duplicate values occurs in another column. In this case, you will need to employ an Excel conditional formatting formula again, and this time we will be using the COUNTIF formula. As you know, this Excel function counts the number of cells within a specified range that meet a single criterion.
Highlight duplicates including 1st occurrences
=COUNTIF($A$2:$A$10,$A2)>1
- this formula finds duplicate values in the specified range in Column A (A2:A10 in our case), including first occurrences.
If you choose to apply the rule to the entire table, the whole rows will get formatted, as you see in the screenshot below. I've decided to change a font color in this rule, just for a change : )
Highlight duplicates without 1st occurrences
To ignore the first occurrence and highlight only subsequent duplicate values, use this formula: =COUNTIF($A$2:$A2,$A2)>1
Highlight consecutive duplicates in Excel
If you'd rather highlight only duplicates on consecutive rows, you can do this in the following way. This method works for any data types: numbers, text values and dates.
- Select the column where you want to highlight duplicates, without the column header.
- Create a conditional formatting rule(s) using these simple formulas:
Rule 1 (blue):=$A1=$A2
- highlights the 2nd occurrence and all subsequent occurrences, if any.
Rule 2 (green):=$A2=$A3
- highlights the 1st occurrence.
In the above formulas, A is the column you want to check for dupes, $A1 is the column header, $A2 is the first cell with data.
Important! For the formulas to work correctly, it is essential that Rule 1, which highlights the 2nd and all subsequent duplicate occurrences, should be the first rule in the list, especially if you are using two different colors.
Highlight duplicate rows
If you want apply the conditional format when duplicate values occur in two or more columns, you will need to add an extra column to your table in which you concatenate the values from the key columns using a simple formula like this one =A2&B2
. After that you apply a rule using either variation of the COUNTIF formula for duplicates (with or without 1st occurrences). Naturally, you can hide an additional column after creating the rule.
Alternatively, you can use the COUNTIFS function that supports multiple criteria in a single formula. In this case, you won't need a helper column.
In this example, to highlight duplicate rows with 1st occurrences, create a rule with the following formula:
=COUNTIFS($A$2:$A$11, $A2, $B$2:$B$11, $B2)>1
To highlight duplicate rows without 1st occurrences, use this formula:
=COUNTIFS($A$2:$A2, $A2, $B$2:$B2, $B2)>1
Compare 2 columns for duplicates
One of the most frequent tasks in Excel is to check 2 columns for duplicate values - i.e. find and highlight values that exist in both columns. To do this, you will need to create an Excel conditional formatting rule for each column with a combination of =ISERROR()
and =MATCH()
functions:
For Column A: =ISERROR(MATCH(A1,$B$1:$B$10000,0))=FALSE
For Column B: =ISERROR(MATCH(B1,$A$1:$A$10000,0))=FALSE
Note. For such conditional formulas to work correctly, it's very important that you apply the rules to the entire columns, e.g. =$A:$A
and =$B:$B
.
You can see an example of practical usage in the following screenshot that highlights duplicates in Columns E and F.
As you can see, Excel conditional formatting formulas cope with dupes pretty well. However, for more complex cases, I would recommend using the Duplicate Remover add-in that is especially designed to find, highlight and remove duplicates in Excel, in one sheet or between two spreadsheets.
Formulas to highlight values above or below average
When you work with several sets of numeric data, the AVERAGE() function may come in handy to format cells whose values are below or above the average in a column.
For example, you can use the formula =$E2<AVERAGE($E$2:$E$8)
to conditionally format the rows where the sale numbers are below the average, as shown in the screenshot below. If you are looking for the opposite, i.e. to shade the products performing above the average, replace "<" with ">" in the formula: =$E2>AVERAGE($E$2:$E$8)
.
How to highlight the nearest value in Excel
If I have a set of numbers, is there a way I can use Excel conditional formatting to highlight the number in that set that is closest to zero? This is what one of our blog readers, Jessica, wanted to know. The question is very clear and straightforward, but the answer is a bit too long for the comments sections, that's why you see a solution here :)
Example 1. Find the nearest value, including exact match
In our example, we'll find and highlight the number that is closest to zero. If the data set contains one or more zeroes, all of them will be highlighted. If there is no 0, then the value closest to it, either positive or negative, will be highlighted.
First off, you need to enter the following formula to any empty cell in your worksheet, you will be able to hide that cell later, if needed. The formula finds the number in a given range that is closest to the number you specify and returns the absolute value of that number (absolute value is the number without its sign):
=MIN(ABS(B2:D13-(0)))
In the above formula, B2:D13 is your range of cells and 0 is the number for which you want to find the closest match. For example, if you are looking for a value closest to 5, the formula will change to: =MIN(ABS(B2:D13-(5)))
Note. This is an array formula, so you need to press Ctrl + Shift + Enter instead of a simple Enter stroke to complete it.
And now, you create a conditional formatting rule with the following formula, where B3 is the top-right cell in your range and $C$2 in the cell with the above array formula:
=OR(B3=0-$C$2,B3=0+$C$2)
Please pay attention to the use of absolute references in the address of the cell containing the array formula ($C$2), because this cell is constant. Also, you need to replace 0 with the number for which you want to highlight the closest match. For example, if we wanted to highlight the value nearest to 5, the formula would change to: =OR(B3=5-$C$2,B3=5+$C$2)
Example 2. Highlight a value closest to the given value, but NOT exact match
In case you do not want to highlight the exact match, you need a different array formula that will find the closest value but ignore the exact match.
For example, the following array formula finds the value closest to 0 in the specified range, but ignores zeroes, if any:
=MIN(ABS(B3:C13-(0))+(10^0*(B3:C13=0)))
Please remember to press Ctrl + Shift + Enter after you finished typing your array formula.
The conditional formatting formula is the same as in the above example:
=OR(B3=0-$C$2,B3=0+$C$2)
However, since our array formula in cell C2 ignores the exact match, the conditional formatting rule ignores zeroes too and highlights the value 0.003 that is the closest match.
If you want to find the value nearest to some other number in your Excel sheet, just replace "0" with the number you want both in the array and conditional formatting formulas.
I hope the conditional formatting formulas you have learned in this tutorial will help you make sense of whatever project you are working on. If you need more examples, please check out the following articles:
Why isn't my Excel conditional formatting working correctly?
If your conditional formatting rule is not working as expected, though the formula is apparently correct, do not get upset! Most likely it is not because of some weird bug in Excel conditional formatting, rather due to a tiny mistake, not evident at the first sight. Please try out 6 simple troubleshooting steps below and I'm sure you will get your formula to work:
- Use absolute & relative cell addresses correctly. It's very difficult to deduce a general rule that will work in 100 per cent of cases. But most often you would use an absolute column (with $) and relative row (without $) in your cell references, e.g.
=$A1>1
.Please keep in mind that the formulas
=A1=1
,=$A$1=1
and=A$1=1
will produce different results. If you are not sure which one is correct in your case, you can try all : ) For more information, please see Relative and absolute cell references in Excel conditional formatting. - Verify the applied range. Check whether your conditional formatting rule applies to the correct range of cells. A rule of thumb is this - select all the cells / rows you want to format but do not include column headers.
- Write the formula for the top-left cell. In conditional formatting rules, cell references are relative to the top-left most cell in the applied range. So, always write your conditional formatting formula for the 1st row with data.
For example, if your data starts in row 2, you put
=A$2=10
to highlight cells with values equal to 10 in all the rows. A common mistake is to always use a reference to the first row (e.g.=A$1=10
). Please remember, you reference row 1 in the formula only if your table does not have headers and your data really starts in row 1. The most obvious indication of this case is when the rule is working, but formats values not in the rows it should. - Check the rule you created. Double-check the rule in the Conditional Formatting Rules Manager. Sometimes, for no reason at all, Microsoft Excel distorts the rule you have just created. So, if the rule is not working, go to Conditional Formatting > Manage Rules and check both the formula and the range it applies to. If you have copied the formula from the web or some other external source, make sure the straight quotes are used.
- Adjust cell references when copying the rule. If you copy Excel conditional formatting using Format Painter, don't forget to adjust all cell references in the formula.
- Split complex formulas into simple elements. If you use a complex Excel formula that includes several different functions, split it into simple elements and verify each function individually.
And finally, if you've tried all the steps but your conditional formatting rule is still not working correctly, drop me a line in comments and we will try to fathom it out together :)
In my next article we are going to look into the capabilities of Excel conditional formatting for dates. See you next week and thanks for reading!
1700 comments
I've just wasted 2 hours trying to get your examples to work - the problem is the way you have written the AND formula which looks like a space has been added in your table - and Excel is not having it! Only when I saw the image of the actual formula entered, without a space did it work. If you're going to provide help, please stop making it more frustrating than it already is by giving the incorrect syntax!
The spacing you have used in the table makes it look like there is a space after the Function AND, when there is not.
Hello Marc!
You can see that there is no space after AND if you copy the AND formula from the article and paste it into an Excel cell.
hi alex. formula to display cells with the results of a specified number
Hi! Please clarify your specific problem or provide additional details to highlight exactly what you need.
He Alexander,
I'm trying to get a cell to change color based on a review comment on another sheet of the excel file.
The cell that I'm trying to change color is the reviewer and based on his response it should color green (approve) or yellow (remarks added).
I've created a formula that evaluates to "TRUE" in a cell on the worksheet but as soon as I paste it in the conditional formatting formula field Excel states it is not a formula, what is happening here?
The formula is =XLOOKUP($D718&"*";DRF[Title];DRF[Rem-MF];"";2)="Approve"
Hi! In conditional formatting formulas, you cannot use structured references in Excel tables. Replace these references with regular cell range references. See more: Relative and absolute cell references in Excel conditional formatting.
Thanks for the answer Alexander, I've changed the formula to =XLOOKUP($D4&"*";DRF!$A$2:$A$5000;DRF!S$2:S$5000;"";2)="Approve". This seems to work.
I've included the column ranges to increase speed of calculating the formatting since using full column references slowed down Excel a lot.
Funny that I've never come across the structured reference restriction for conditional formatting anywhere on the web while searching for a solution to this.
I need help with figuring out if what I'm wanting to do is possible. I'm trying to update a spreadsheet a co-worker created. It has all employee names in one column and then other columns have department names, and other business releated stuff. Each column has employee names listed underneath. All the data is in black font but I went in and changed the font color in the main employee column so that each department has a different font color. Is there some type of conditional formatting formula that I can enter so that all the data in the other columns will update to match the font color in the main column. For example, if Susie Smith has blue font I want her name in all other columns to change from black font to blue font. This list has over 3000 names on it so I dont want to do one at a time.
I hope I explained good enough so you know what I'm wanting to do.
thanks for the help!
Scarlett Jo
Hello Scarlett!
Using conditional formatting, you can change the format of all cells in which the value "Susie Smith" is written. For the detailed instructions, please see: Change a cell's color based on its current value
Hello there, great article.
I am new to all of this and I am trying to get my head around all the information in your article. I cannot even get the =$C2>0 to work correctly yet and I am working through it all trying to teach myself.
Having trouble subbing in some text value in the formula.
I have a need for two cells to change colour, if one of those cells contains specific text.
I have copied my formula into every cell for one of my rules.... hoping there is an easier way?
Current Formula
Apply to range : C11:D11
Format all values where this formula is true: =$D$11="TBA"
My Sheet is a Roster. Different departments in different areas of the sheet.
I have a list of roster positions to the left (Column C). These cells will be empty or contain a name. The cell to its immediate right (Column D) will have more information about the shift or employee.
Nadia (Column C) TBA (Column D)
Right now I have a drop down in Cell D11 (I select the text TBA) and the cell (now containing the text "TBA") as well as the cell to its immediate left (C11) changes colour.
I have copied this formula into every cell that I need it to work for.
Format all values where this formula is true: =$D$12="TBA" Apply to range: C12:D12. =$D$13="TBA" Apply to range: C13:D13... and so on and so on.
How I want it to function
The cell on the left is a position in that department. It could have an employee's name or be empty. The cell on its right is a condition of that employee or position. Nadia (cell to the left) TBA (cell to the right) for example, means they are rostered to work, but there is more information to be advised (TBA). So I select TBA in the cell next to their name and that cell and their name change colour. Now I also have the need to overwrite the condition cell (on the right) with more information. Now I wish to include the shift time and a condition. For example, 0545-1945 RTW. Now that the cell on the right contains the text RTW, I want that cell and the cell to the left (with employee's name or empty) to change colour.
I have spent quite a bit of time trying to make this clear and I am grateful for any help you can give. I just hope to be able to understand the assistance. Think I love this stuff and will need to go on a proper course!
Hello Benjamin!
If you want to apply conditional formatting to a range of cells, do not use an absolute cell reference in the conditional formatting formula. For example, for the range C11:D11, the formula could be
=$D11="TBA".
I recommend reading this guide: Relative and absolute cell references in Excel conditional formatting.
To find a particular word in text in a cell, use the SEARCH function.
For example:
=ISNUMBER(SEARCH("TBA",$D11))
For more information, please read: How to find substring in Excel
Hi there,
Love your articles as they are very helpful.
Is there a way to create a conditional format whereby if a cell has a formula inside which includes a +1, then it colours it differently? I'd want to put this condition on specific columns for a pay sheet where if an employee works an evening shift and is paid an extra hour premium, once I enter the +1 in the formula of total hours, it automatically highlights that cell in a different colour.
I.e. Formula in cell F205 is =(IF(D205>E205,E205+1,E205)-D205)*24
result would be no highlight in cell F205
but if cell F205 is =(IF(D205>E205,E205+1,E205)-D205)*24+1
then cell F205 would highlight in green
Any help would be appreciated
Hello Margaret!
Use the FORMULATEXT function to extract the formula text in the cell. Then determine if there is a partial match between the text string "+1" and the formula text. For more information, please read: How to find substring in Excel. Here is an example of a conditional formatting formula:
=ISNUMBER(SEARCH("+1",FORMULATEXT(F1)))
I need to format one column based on another column being blank. is there a format for that?
Hi! All the necessary information is in the article above.
Hello,
I love your articles, & find them very helpful! Here's my problem, using conditional formatting.
I want a cell A to change color when cell B meets a certain value, (say 25), and cell C is between a certain range, (say 1-10).
I understand the range part =AND($C$1>=1,$C$1<=10)
I just can't seem to get my head around adding the cell B condition to the formula?
Any help would be greatly appreciated!
Hi! If I understand you correctly, just add another condition to the AND formula. For example:
=AND($C1>=1,$C1<=10,$B1>25)
Hi, I want to know how I could use the conditional formatting for the range of cells, considering their total sums.
(Ex: total value of A column selected cells; total value considered with B, C, and D column selected cells.) If the A column selected cell total value is the lowest, then it should be highlighted with green (using red-yellow-green color scale formatting).
Hi! I don't really understand from your description which cells you want to compare. However, you can determine the lowest value using the MIN function. Here's an example of a condition:
=A1=MIN(A1,B1,C1,D1)
If this is not what you wanted, please describe the problem in more detail.
1 A B C D
2 MALA SEETHA RADHA RAMA
3 500 200 150 162
4 600 300 600 150
5 700 20 inlcuded 170
6 800 250 included 180
7 900 50 850 200
8 600 400 900 400
9 200 60 200 750
10
11 4300 1280 2700 2012
I need to use the conditional formatting considering the total value of each and every column selected cells.
Ex: What is the range of A4, A5, A6 total compared to the total of B4, B5, B6, Total of C4, C5, C6 & Total of D4, D5, D6
Instead of one cell, use the sum of three cells. Here is an example of the formula:
=(A4+A5+A6)=MIN((A4+A5+A6),(B4+B5+B6),(C4+C5+C6))
I have a checklist in Excel. There is a box/cell next to each item. At the end of the list, there is a "done" box/cell. I want to use conditional formatting so that if I place an "X" in the Done box/cell, it'll put an "X" in all of the boxes/cells in the list above. But anything manually keyed in an individual item's box/cell would override the "X" that would appear if the Done box/cell had the "X".
I realize I could use a regular formula, not conditional formatting, to achieve this, but I don't want the formula showing in the blank box/cells. I want it embedded there through conditional formatting.
Hello Nate!
You cannot change values in cells or checkboxes using conditional formatting. Therefore, you will need to use either a formula or a VBA macro to change the values.
Good aftrenoon
Can I please ask for some assistance? I hope that i am wording this correctly.
I am stuck for a formular for a specific task that I am wanting to have on my excel sheet.
I am wanting highlight cells on a row to enter a date between eg. D1 and K1.
the highlight would be by having a date entered in D1 and have the cells highlighted up to K1. A date will then be put in
at a later date in K1, once this date is put in the cells will then be unhighlighted.
I hope that this can be achieved. Thank you very much for your help.
Hello Cassy!
To solve your problem, you can use conditional formatting. This is described in the article above.
For the range of cells that you want to highlight in color (for example, E1:J1 or E1:J20), use the conditional formatting formula as follows:
=AND(D1<>"",K1="")
Hi I have drop down option in a cell and depending on the answer I want another to fill. How is this done please ?
If the answer genuine is selected in cell how do I get cell next to it to fill black ?
Hi! The following tutorial should help: How to make a dependent (cascading) drop-down list in Excel. To answer your second question, read the article above carefully.
Does anyone know how I can formulate the following - I'm trying to set up a training event calendar and have two sheets in the workbook. One with a calendar with dates along the top and each department underneath -
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We
Business op's
Architects
PMO
Capital
Property
Id like to add conditional formatting along each department line colouring in the cell based on a date and the duration per each sub department. Id then like to formulate the coloured cells so when I click on them it takes you to the exact event in the event information tab -
Description Event 1 Event 2 Event 3
Capital Event Name Capital Group
Number of days 5
Time of Event 9am - 5pm
Start Date 24 January 2024
Hi! For information on how to format by date as condition, take a look at this article: Excel conditional formatting for dates & time: formulas and rules. If I understand the problem correctly, you will also find this article useful: Change the row color based on cell value.
To move to another cell or worksheet after clicking a cell, you can use hyperlinks. See here for detailed instructions and examples: Hyperlink in Excel: how to create, edit and remove and 3 ways to insert a Hyperlink to another Excel sheet.
I hope my advice will help you solve your task.
I have 2 sheets (sheet1 and sheet2). I have set of words in both sheets same columns (B).
I want to check words of each cell in sheet2 with range of words in sheet1 and change background colour of row whose word exists in sheet1's set of words.
I tried using this lessons but I am unable to check value of each cells one by one.
means that in conditional formating formula when I write this formula "=COUNTIF('sheet1'!B10:B45,'sheet2'!B$10)" then 'sheet2'!B$10 is remaining same and it is not changing to 'sheet2'!B$11 or B$12 as per cell.
how can I do that?
I have tried "sheet2'!B11" this also (relative value - means not using $ sign ) then also not getting desired output.
Hi! Please read the above article carefully. Here is an example of a conditional formatting formula for column B on Sheet2:
=COUNTIF(Sheet1!$B$1:$B$10,Sheet2!B1)
I also recommend looking at this article: How to find and highlight duplicates in Excel
if the below is typed in a cell
80 x 80 x 3 x 6000
can we get the product of these numbers in another cell . the answer has to be 115,200,000.
is it possible
Hi! Get individual numbers from text using the TEXTSPLIT function.
Convert these numbers written as text into regular numbers using a mathematical operation or other methods described in this article: How to convert text to number in Excel.
Find the product of these numbers using the PRODUCT function.
The formula below will do the trick for you:
=PRODUCT(--TEXTSPLIT(A1," x "))
Great resource! Only place I could find how to format based on multiple conditions from other cells. Thank you!
We have a complex formula that produces post menstrual gestational ages into a cell.
Example. Our formula provides a value 34.2 which is 34 weeks and 2 days. Our formula is also set to adjust this values every day so it’s up to date with the date change.
When we follow instructions to a T, it doesn’t work right even tho our formula is correct. Is there a reason conditional formatting won’t work if it’s formatting a cell(s) that have a value that is produced from an already complex formula?
Hi! I don't know what "instructions to a T" means. Conditional formatting works with the value that the formula returns. To give more precise advice, you have not given any information.
Hi Alexander, Thanks for taking time to help those of us who are struggling with Con formatting BRAVO ZULU!
My problem:-
I have set of scattered cells, (that are percentages) in a column. I am looking to flag these cells red, if their sum is is not equal to 100%.
say B18= 2%, B41=32%, B58=33% and B76=34%. The sum of these =100% so, no color change to b18/b41/b58/b76.
If the sum is not equal to 100% change these 4 cells to red
Thanks for your assistance.
Hi! Find the sum of the cells you specified and compare to 100%.
=B18+B41+B58+B76 <> 100%
It works!!!
Thanks so much, looks so simple when you set it out.
I battled for hours and got nowhere- slowly.
Thanks again
Hi,
I am struggling to conditional format cells. What i need is if the word in in column A that the content of the Cell in A and B changes font colour. ( like a colour code )
Column A has the Identifying criteria, such as book Genre and Column B has the book title.
Hi! Create a separate conditional formatting rule for each colour (each condition). Use the recommendations from the article above. For example:
=A1="Genre"
And if you want to change the colour of the whole row by condition, use these guidelines: Change the row color based on cell value.
I hope it’ll be helpful.
I managed to conditional manage cells .. for example
if value of cell A1 = >0 .. then cell A2 is colored red
BUT what to do if I want to formate ..
if value of cell A1 = >0 .. then cell A2 has the value of 1
(used for automatically counting the cells that have a value >0)
Is that possible?
Hi! What you want to do is not formatting a cell. To set a value in a cell depending on the value in another cell you use the IF function. The following tutorial should help: IF function in Excel: formula examples for text, numbers, dates, blanks.
=IF(A1>=0,1,"")
To automatically count cells that have a value greater than zero, use the COUNTIF function. Read more: COUNTIF function in Excel - count if not blank, greater than, duplicate or unique. For example:
=COUNTIF(A1:A10,">0")