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 2016 and 2013.

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 formulas for conditional formatting based on cell value

Excel's pre-defined conditional formatting rules are mainly purposed to format cells based on their own values or the values you specify. I am talking about Data Bars, Color Scales, Icon Sets and other rules available to you on the *Conditional Formatting* button click.

If you want to apply conditional formatting based on another cell or format the entire row based on a single cell's value, then you will need to use Excel formulas. So, let's see how you can make a rule using a formula and after that I will provide a number of formula examples for different tasks.

### How to create a conditional formatting rule using a formula

As you** **remember, in all modern versions of Excel 2016, Excel 2013, and Excel 2010, the conditional formatting feature resides on the *Home* tab > *Styles* group. In Excel 2003, you can find it under the *Format* menu.

So, you set up a conditional formatting rule based on a formula in this way:

- 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.

- Convert a range of cells to a table (
- 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.

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.

### Excel formulas to work with text values

If you want to apply conditional formatting to selected columns when another cell in the same row contains a certain word, you can use a simple formula like `=$D2="Worldwide"`

(we've used a similar formula in one of the previous examples). However, this formula will work for **exact match** only.

For **partial match**, you will need another Excel function: *SEARCH()* You use it in this way:

`=SEARCH("Worldwide", $D2)>0`

- format selected cells or rows if a corresponding cell in column D contains the word "*Worldwide*". This formula will find all such cells, regardless of where the search text is located in a cell, e.g. "*Ships Worldwide*", "*Worldwide, except for…*" etc.

`=SEARCH("Worldwide", $D2)>1`

- shade selected cells or rows if the cell's content starts with the search text.

### 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 1^{st} 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 1^{st} 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 2^{nd}occurrence and all subsequent occurrences, if any.

Rule 2 (green):`=$A2=$A3`

- highlights the 1^{st}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 2^{nd} 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 1^{st} 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!

Hi! I have a bit particular case. I have to find duplicates (max 5) in column A worksheet_1 and copy only one of each duplicate in column A worksheet_2. Then I have to copy values from B worksheet_1 that correspond to each duplicate in B1:F1 of worksheet_2.

For example:

worksheet_1 worksheet_2

A B A B C D E F

1 kl5f 1 k15f ozpp

2 l9j8 2 l9j8 kol

6 yu60

2 kol

1 ozpp

Thank you in avance

Normally the exemple was suppposed to be with spaces...

Hi Jelena!

It's a bit difficult to understand what exactly result you are trying to achieve without seeing your data. If you can send me (support@ablebits.com) your sample workbook and the result you are looking for, I will try to help.

what i m trying to do is that, if i enter value in single cell of a row the clour of that row or the selected cells should be changed by entering the data in the cell

If you want to color the entire row based on the data in a certain column, then select all the rows and columns with your data and create a rule using this formula:

=$C2><""

Where C is your column, 2 is the first row with data.

If you want to highlight a row when at least one column contains data, use this formula:

=countif($A2:$G2,"><"&"")>0

Where A and G are correspondingly the first and the last columns you want to check.

i have a work sheet, many column,in a column many date are 14/15/16/17 if 15> then total row move to another sheet automatic

In this case Excel formulas cannot help, this task can be fulfilled using a macro.

Hi,

Can you please give an answer of conditional formatting which is compared above for two columns where in countif formula has been used. Can you please brief. Because that scenarion is exactly with my question but in that i found one querry which is -

Products are mentioned in column a and sales vales are mentioned in the other column. The conditional formatting which is used in that is not exactly giving the actual reaults.

Because i hv seen and practically applied..

scenario-

Product1 2

Product2 4

Product3 6

Product4 3

Product1 2

Here if product is matching and if the aale value that is matching then it should highlight both with the help of cnditional formatting however its still highlighting incase product one is mentioned two times and sale value ia differerent. So in that case it shiuld not highlight but its highlighting.

Plz assist to resolve this scenario.

Thanks in advance...

Hi Hitesh,

There are two ways to fulfill your task: using a helper Column or our Duplicate Remover add-in.

If you choose the former, do the following:

- Add a helper column to your table, e.g. column C, and enter the following formula in cell C2:

=concatenate(A2,B2)

Where A and B are the columns you want to compare, 2 is the first row with the data.

- Select columns A and B and create a conditional formatting rule using this formula:

=countif($C$2:$C2,$C2)>1

If you use the Duplicate Remover, you won't need to create a helper column and mess around with formulas. Just pick the "Fill with color" option on the final step of Duplicate Remover Wizard.

Hi Svetlana,

Thanku so much. Its really awsome. My question has been reaolved. But there is a small thing which i wanted to add in.

The scenarion which i discussed below related to conditional formatting by using countif formula.

But the first product no. And sales value is not highlighting except that its highlighting from the below duplicate.ex-

Below is tge scenario resolved with sugesstions provided by you. But firat plan is highlighting with by using countif formula and the next plan no. Which is 12345 and the same amount i.e.:-200 is highlighting

Plan no. Name amount column d

12345 a 200 =concatenate

(A,b,c)

135937 b 300

847474 C 400

92828 d 500

12345 a 200

95850 e 600

12345 a 100

Please assist and advise if i can through these duplicate plans in another or sheet 2 without help of macro...

Thanks in advance....

Hi svetlana,

Can you please provide an update on above question..

Thanks,

Hitesh

Hi! was wondering if you can help me with something on the similar subject.

Column A + Column B = $F$5

A Basic example is Column A has 2.70, 5.40, 8.10 Column B has 10.80, 21.60, 32.40 if I put 13.50 in the box I'd like the 2.70 in Column A and 10.80 to be highlighted in Column B etc.

I've tried different ways like =A3+B$3=$F$5 and/or =B3+A$3=$F$5 but nothing seems to work can you help me.?

Thanks

Hi Derek,

You were almost there : ) You need to create a

separate rulefor column A and column B with this formula: =$A3+$B3=$F$5 Please note, it will work for Column A + Column B = $F$5, only if values in columns A and B are in the same row.If you want to highlight values in different rows that make a sum, you will need a bit more complex formulas:

For Column A: =ISERROR(MATCH(ROUND($F$5-$A1,10),$B$1:$B$10,0))=FALSE

For Column B: =ISERROR(MATCH(ROUND($F$5-$B1,10),$A$1:$A$10,0))=FALSE

Wow that's a lot more complex than I thought it would be lol

Ok last question I promise if I wanted to add one more column later what would I input?

Thanks so much for your help I couldn't have worked that out for myself

Hi Derek,

I'm glad to know the formulas have worked for you : )

If you are asking about the 2nd case (sum in different rows), regrettably it's not possible to do in 3 columns (i.e. A + B + C = $F$5) using conditional formatting formulas, at least I do not know any way. This would require 2 nested loops, which can be done as a macro only.

Hi, i want to format a cell based value of different cell. Please let me know how to do it.

Ex: If value in Cell E2="Yes" the F2 cell needs to be in date format.

Hi Naveen,

I'm sorry, I do not have any idea on how to do this. I'm not even sure this is possible in principle.

=OR($E2="Yes")

Use the Formula for conditional formatting E2="Yes" and set the format section to date format you want, but you do that in the cell you want to format. You still have to enter the date in that cell.

Hi,

I have an answer for this if you can explain in brief..

Thanks,

Hitesh

I am having an issue with using conditional formatting on my excel project. I want to highlight each number in a row that is different from each other in one single conditional formatting formula. How would I do that?

If my understanding is correct, you need to highlight unique values in each row. If so, the following formula will work a treat, where A is the first column and H is the last column with values:

=COUNTIF($A2:$H2,"="&A2)=1

I am trying to find a formula to highlight the entire row based on the conditional formatting of one column.

I formatted column 1 to highlight duplicates, and I want excel to highlight the entire row if there is a duplicate.

Is this possible?

Hello Sarah,

Of course, this is possible. You just need to extend the range for the formula to get applied to the entire table rather than 1 column. Simply open the Conditional Fromatting Rules Manager and change the range in the "Applies to" box.

As an example, please see "Check for duplicates across multiple columns" in this article. As you see in the screenshot, the formula applies to the range A2:C9, and as a result the entire rows are highlighted based on cell value in column C.

Thank you! The second suggestion worked!

Hello,

My conundrum is this:

Cell I13 has zero formulas nested and only represents whatever number i type into it. I need the text or fill in cell I13 to be green if it's value is greater than or equal to the value in cell I14 and I need the color to be red if its value is less than the value represented in cell I14. I14 has a nested formula which represents a numerical value from cell D4. I have tried the Conditional Formating rules to no avail; is this algorithm even possible?

Hello PH,

I've just tried creating 2 rules for cell I13 with the following formulas, and they worked just fine:

Red: =$I$13<$I$14 Green: =$I$13>=$I$14 My cell I14 has a simple formula =D4, though in theory this should not make any difference. If the above formulas do not work for you, please specify which exactly formula you have in I14 so that I can test on the same data.

similar to the question above, i want a conditional formula that i can apply to multiple cells in a range. if a cell contains a number > the number in the cell above, i want green; if the cell contains a number < the number in the cell above, i want red. i would like to drag this condition all the way down the column. is this possible?

nevermind. i think i figured it out. you can delete my thread.

Hello,

This already looks like an oracle now. I have an other challenge with duplicates. I have a file with different sheets. In Sheet D there is a cell that fills automaticly with information from the other sheets. I use this to generate Meta data for my website which I can import.

Some of the data in Sheet D are duplicate. I like to make a rule which will change the data in this sheet/cell automaticly if the outcom of the formula used in Sheet D , Cell A is a duplicatie with a cell above in the same column.

I hope you can help me with this info.

Thanks

Rutger

Hi Rutger,

Try creating a rule with this simple formula =A2=A1 where A2 is the top-left most cell in the range where you want to color the duplicates and A1 is a cell above. This rule will color the second duplicate occurrence. If you need to highlight the first one as well, create one more rule with this formula =A2=A3.

This solution works fine for one and several columns, except for the case if you have data in row 1. Hopefully this is not the case and you have column headers there : )

Hi Svetlana,

First what an amazing blog, I only occasionally use excel I had no idea it could do so much!!

My problem is that when I use the formula =D3=C3 to highlight duplicates (where the first cell of data is c3) it highlights the first occurrence of the duplicate, not the second. I don't need the first highlighting but I do need the second. I don't know what I am doing wrong.

Please help and keep up being the excel fairy!

John

Hi John,

Thank you so much for your kind words.

The formula I suggested for Rutger is purposed for highlighting duplicates in the same column. As far as I understand, your formula is comparing cells in columns D and C, in the same rows. So, if you want to highlight only duplicate values in column D, the formula will work, just make sure the rule applies solely to this column.

If you are looking for something different, please provide a bit more details.

Hi Svetlana,

Thanks for the response. Yes it does highlight the duplicates but it highlights the first example not the last. I don't want the first highlighting. So I need to know if a value has been repeated on the same row. So imagine 3b, 3a, 3a, 4c on a row of data I would only want the 2nd 3a highlighting not the first one. Using the formula you gave it highlights just the first ie: 3b, 3a, 3a, 4c. I don’t want this.

Also I need it to highlight multiple duplicates and non consecutive duplicates. I need it to 2b, 2b, 2b, 2a . I also need it to do 2b, 2a, 2b, 3c,. So in all the examples I need only the second repeat to be highlighted. Hope you can help.

Yours

John

Hi John,

Got it, please try this one:

=COUNTIF($A3:A3,A3)=2

Where 3 is the first row and column A is the left-most column with data. The rule shall be applied to all columns (not including the header row), though only the left-most column is included in the formula.

Wonderful Svetlana,

You are a genius and a true excel fairy. Many thanks indeed.

John

Hello,

I am wondering if there is a way to apply icons to words and not just numbers.

For example the icons are in column B and I would like the "green check" icon to display when column J reads "YES".

Is that possible?

Hi Kathleen,

You can do this with the help of this formula =IF(J2="YES",1,""). Copy the formula all across column B, starting from cell B2.

Then create an icon set rule and set a green flag for values >=1. Remember, to select the option "Show icon only".

Can you do this for more than one cell? I need to do this for my spreadsheet but I have many many rows and would like to use one general rule rather than a rule for each line. But I also want to be sure that it's looking at each line to format and not just the first one and carrying that cell's value forward for the formatting of the rest.

For example, Column B contains either a "Yes" or a "No" for each row and I want the corresponding cell in column P to have red fill if Column B for that row is "No."

I figured out a workaround. Ideally I wanted my Column P to be filled but for now I've inserted a column that puts a Red X as you suggested in your reply to Kathleen.

Hi Mallory,

The beauty of Excel conditional formatting is that you don't need to create a rule for each row! Just apply the rule to as many rows as you want to color, write the formula for the first row using a relative cell reference (like A1) or mixed cell reference (like $A1), and Excel will compare the values in each row, like it does when you copy a formula down a column.

In your case, you could create 2 rules, say for P2:P1000 (where P2 is the first row of data), with these formulas:

=$B2="yes" and =$B2="no"

For more information, please see Relative and absolute cell references in Excel conditional formatting rules.

I have columns with dates in them. Each row is a different activity and the columns represent different schedule versions. If column C has one date and then a different date in column D, I want column to highlight in a color depending on if it occurs before or after the date in column C. I want to carry this down across several rows, but for some reason the conditional formatting is based only on the first row of data. How can I get the conditional formatting to apply to each individual row?

You just need to use an absolute column and a relative row in your formulas. Please try these ones (assuming that row 2 is your first row with data):

=$C2>$D2

=$C2<$D2

Hi! I'm having a problem figuring out how to get conditional formatting to work in the following scenario.

I have a 3 column table. A and B will either have "Yes" or "No" as values. If both A and B = Yes, I want to highlight that row green. If both A and B = No, I want to highlight that row red. And if A and B have differing values from each other (e.g. A=No, B=Yes), I want to highlight that row yellow.

I'm pretty sure I need to have 3 different rules, but other than that, I'm not sure where to start. I feel like this must be easier than I'm making it but I'm not sure how absolute and relative cell references work, and I think maybe that's part of my problem. Any help you can provide would be greatly appreciated! Thanks so much!

Hi Jen,

Right, you will need 3 rules with the following formulas:

Green: =AND($A2="Yes", $B2="Yes")

Red: =AND($A2="No", $B2="No")

Yellow: =$A2<>$B2 (in plain English, the <> operator means "not equal to")

As for the cell references, I will try to explain in more detail:

- Absolute cell references (with the $ sign) always remain constant, no matter where they are copied. Because you always compare values in columns A and B, you should use an absolute column reference. As you can see, the dollar sign ($) appears before all column letters in the above formulas.

- Relative cells references (without the $ sign) change based on the relative position of rows and columns, when copied across multiple cells. Since you need to compare values in each row individually, you use relative row references in the formulas.

In conditional formatting rules, cell references are relative to the

top-left most cellin the applied range. So, you can simply pretend as if you are writing a formula for the top-left cell only, A2 in our case.Absolute and relative references in conditional formatting formulas behave in the same way as in usual Excel formulas (as described above). So, because you use relative row references, your formulas will "get changed" for each row and compare the values in columns A and B in each individual row. I hope this makes sense :)

Svetlana,

Thank you so much for explaining the absolute and relative cell references. I looked it up more after I posted my question, but you've explained it better than anything else I've found!

As for the conditional formatting formulas -- I had the red and green rules correct, except for the mixed references; the yellow formual I did not have correct and I'm not sure why I failed to find such an easy solution. The not equal to operator makes perfect sense.

Thanks so much!

Jen

How do I test for the value of a cell color? I have a spread sheet where my customer combined rows of the same kind with a cell color. They did this manually. However I need to export this to a publishing program so is there a search for this? In the past, before the customer used color fill, I tested the data (=IF(F319=F320,"","{RULE}") and then I was able to place a rule below each group. Now with the cells filled with color, I'm at a loss.

Thanks!

Hi Steve,

You can use a user-defined function to count color-codes cells, we provide the ready-to-use code in this article - How to count and sums cells by color in Excel. You will need only the GetCellColor function that returns the background color code of the specified cells. You can use this function within your IF formula like this: =IF(GetCellColor(F319)=GetCellColor(F320), "","{RULE}").

I am trying to do some Dynamic highlighting bas on a data validation list. My issue is when I create my conditional formatting formula =$J45=$E$40, the dynamic is only work for 1 value. When I switch values in the dropdown, the formula no longer works for the table range. Why is this?

Hello Bethany,

It's very difficult to say what the problem may be without seeing your data. Your formula works for column J only since you use an absolute column reference. Is this correct? Anyway, if you can send me your sample workbook at support@ablebits.com, I think we will be able to help better.

Thanks for this awesome blog !!!

Yet i could not crack this.

I have value in cell a1 to a5 and b1 to b5. Column a is output of path1 and column b is path2. Now i need to compare value of column b with column a and color column c with 3 colors using data bars to show the magnitude.

1) green : if column b value is lesser than a

2) yellow: if column b value is equal to column a

3) red : if column b value is lesser than column a

Now the c column should have a data bar to indicate how good or bad the value in column b is compared to column a. I spent too much but i eventually end up forgetting my location !

Can you shed some magic on this please

Hi Amarnath,

3 data bars of different colors cannot be displayed at the same time in one column. But you can try this way:

- Enter the following formula to cell C2 that will calculate the difference: =B2-A2

- Copy the formula across the entire column C.

- Apply the Green Data Bar to column C (negative values will be colored in red).

To hide the values and leave only the data bar visible, click 'Manage Rules' under Conditional Formatting, double-click your Data Bar rule and select the option "Show Bar Only".

As an alternative, you can consider using sparklines.

I have a situation in which I'm applying conditional formatting to data that can be in three different ranges. For example if a cell has a value below a certain number, it colors green, if it is between two values, it colors yellow and if it is higher than a value, it colors red. I have this part down with three separate rules.

However, these ranges will change based on gender, which I have in an earlier column. Therefore, there are two different sets of three rules I want to apply to a row of data. What I want is that if C3, for example, reads female, then three specific conditional formatting rules will be applied to J3 which would be different than if C3 read male.

I would love any help you could give me.

Thanks!

Hi Carl,

It is not possible to create a conditional formatting rule that would force another rule or set of rules to apply to a certain range of cells. Instead, you can create 6 separate rules combining both conditions in one formula, e.g.:

=AND($D3>0, $C3="male")

If you are looking for something different, please send me your sample data at support@ablebits.com and we will try to figure out the proper formulas.

Svetlana,

Thank you very much for your time on this. That was helpful and again informative. I will use this suggestion.

You have an awesome blog here. Thanks.

Make it a great day !

I am making a spreadsheet and want to highlight specific duplicates. Like if a name pops up 3 times I want it green...4-9 times I want yellow. and 10+ times to be in red or something. What rule do I want to set up for this? Do I have to find the first instance of a name and create each rule based on that?

Nevermind...figured it out. I'm dumb

Hi Jared,

As I see in the comments timestamps, it took you just 16 min to figure out the solution. So, you definitely are not : )

Hi,

I have conditional formatting set so that the fill turns green if it equals a certain number. There are 5 numbers that meet that criteria in a row, 4 of them turn green and the 5th one does not. They all have the same formats and formulas. Do you know why it is leaving out that one number?

Thanks!

Hi Mike,

The most obvious reason that comes to mind is that the format of the problematic number is different from all others. You can try to copy the format from some other cell where the rule works well to that problematic cell using Excel's Format Painter. Also, make sure your formatting rule applies to the entire rows. If neither is the case, you can send us your workbook at support@ablebits.com and we'll try to figure it out.

Hello,

If I have a set of numbers is there a way I can use conditional formatting to highlight the number in that set that is closest to zero?

Hello Jessica,

Thank you for your interesting question!

If your data set consists of positive numbers only, you can use this simple way:

- Select your data set.

- Click Conditional formatting > New Rule... > Format only top or bottom ranked values.

- Under "Format values that rank" section, select "Bottom" from the drop-down list and put 1 in the box next to it.

If your data consists of both positive and negative values, then a solution is a bit more complex. I've added a couple of examples to the post because this is really a very interesting question and other users may find the examples helpful. Please see How to highlight the nearest value in a data set for full details.

Hello,

I have conditional formatting on my dates and they turn color based on 30, 60 90 days past due date. What i need next is to change my status column to match the date colors. I have status' of Open and Closed. If they are open they should match the color of the date, red, orange or green if over certain days, if it is closed it can remain black. Any help is appreciated.

I forgot to mention I was using this formula with no luck - just turns everything red for open =IF($K2>30,$C2="open","")

Hi Michelle,

I'm not sure I completely understand the task, so let me check. You have a status column C that contains words "Open" or "Closed", this is absolutely clear. You have another column K with what kind of entries - numbers or dates?

If numbers, you can change the color of your Status column by creating 3 conditional formatting rules with a simple formula like this:

=AND(C2="open",K2>30)

If dates, then please provide more details on how you determine the past due date. If you can send me your sample workbook at support@ablebits.com, this will be a faster way : )

Hello,

they are dates. They turn color based on 30, 60 and 90 days past the due date. I need the status column to do the same if they are Open and Closed so that we can monitor what is not done on time. Maybe there is another way?

Hi, first thanks for your great blog!

I am trying to get the cells on column A to change to green when F, G and H contains "Done" or "N/A". I has tried a couple of different formulas but no luck.

It should be something like:

=AND((OR($F$3="Done");($F$3="N/A"));(OR($G$3="Done");($G$3="N/A"));(OR($H$3="Done");($H$3="N/A")))

If you find some time, can you guide me to the right solution please?

I found a working solution :)

=AND(OR($F3="Done";$F3="N/A");OR($G3="Done";$G3="N/A");OR($H3="Done";$H3="N/A"))

Excellent! Sorry for not being able to respond earlier, this is because we do not monitor comments on weekends :)

Hello,

I tried to send my sample workbook but I keep getting an error!

It says: "The error that the other server returned was:

550 5.1.1 : Recipient address rejected: User unknown in virtual alias table"

Please help!

Thanks!

Sorry, Carl, this is my fault - there was a misprint in the address. Don't know how that could happen, I typed it hundreds of times... Here is the correct one (double checked : ) - support@ablebits.com

I have a problem in excel format date is in one sheet and my condition

=if(mid(sheet!y6,11,5)='F316L','XXXXXXXX',YYYYYYY)

THIS IS WORKING OK WHEN THE DATA IS F316L BUT WHEN DATA IS ' 12 '

VSD

Reply

Hi SHARADA,

Sorry, I am not sure I understand your formula. Why are 'XXXXXXXX' encapsulated in apostrophes while YYYYYYY aren't? And what is '12' VSD? I think it will be easier for me to understand if you can provide a sample of your data.

DEAR SIR/MEM

WHEN I SELECT ROW AND COLUMN ITS NOW SHOWING IN NORMAL BLUE COLOR

..I WANT TOSAY THAT WHEN I DRAG A CELL ITS NOW SHOWING THAT I M SELECTING

HOW CAN I SOLVE IT PLZ REPLAY WITH ANS..

UR FAITH FULLY USER

CHANDRESH VAVADIYA

Hello CHANDRESH,

I am very sorry, but I do not understand your question. Anyway, I believe the issue does not relate to Excel conditional formatting.

Afternoon

I am trying to get a cell A2 to fill green if cell B2 says Approved or fill amber if cell B2 says Pending. Cell B2 will always start at Pending and then will be overtyped with Approved as and when, and would like cell A2 to update itself based on this change. I have tried a number of ways, but can only seem to get the formatting to change for one or the other not both. I'm sure I have used conditional formatting for something like this before. Is there anything you can suggest?

Thanks :-)

Hi Alison,

You simply have to create 2 rules with different colors for column A:

Green: =$B2=”Approved”

Amber: =$B2=”Pending”

Did it work?

Hi

I have a roster schedule that uses conditional formatting for each day based on where the employee is (OT/ AL/ Work/ Off tour etc) What I would like to do is highlight the entire column of what day it is today.

Ie column HE is today's date (29 July) I would like the entire column (which has other conditional formatting values and then blank cells) to be a certain colour so it is easier to navigate back to what day it is.

I have the 'TODAY' date formula in cell A1.

Have tried various ways and can get the single cell (HE) to highlight, but not the entire column.

Thanks for any help

Hi Sarah,

I think you can handle it in this way:

- Select the entire table without column headers and create a rule with either formula:

=A$3=TODAY() or =A$3=$A$1

Where A is the first (left-most) column of the table and 3 is the row with dates (table headers).

Depending on what you are trying to achieve, this rule should be either the 1st or the last in the list of conditional formatting rules.

If it is the 1st, the column will change the color but individual cells might get colored in different ways based on your other rules. If it is the last, the entire column will change the color overriding all other rules.

OH THANK YOU Soooo much! First formula worked a treat.

Hi Svetlana,

I feel I'm really close to receiving an answer in this article. If you see "Compare 2 Columns for Duplicates", it doesn't have an explanation as to how I can have excel put these matching cells on the same row (your picture is a great example of my problem). I need them to be on the same row because I have data attached to the duplicates that changes monthly (however, the name remains the same). Do you know how I can have the rows match up?

Thanks in advance for your assistance!

Hi Harrison,

I believe this can be done using Excel's VLOOKUP function or our Merge Tables add-in. If I can have a look at your data, I think I will be able to suggest the right formula. So, feel free to send me your sample workbook at support@ablebits.com.

Hi

I need to highlight any cells that contain an absolute value rather than a formula i.e. the formula has been overtyped with a value. Is this possible with conditional formatting?

Hi Chris,

If you use Excel 2013, you can create a conditional formatting rule with the below formula (where A2 is the top-left cell of your range):

=ISFORMULA(A2)=FALSE

If you use Excel 2010 or lower, you will have to add User Defined Function (VBA code) to your workbook because ISFORMULA was introduced in Excel 2013 only. Here is the function:

Function IsFormula2010(ByVal cell As Range)

IsFormula2010 = cell.HasFormula

End Function

If you do not have much experience with VBA, these step-by-step instructions will be helpful.

After the above code is added, you can create a condition formatting rule with the same formula:

=ISFORMULA(A2)=FALSE

Hi - this is a very useful site! I need to format cell C5 to say 'YES' if cell B5 is greater than 100, and for C5 to say 'NO' if it is less than 100. I am sure that this is very simple but I can't work it out! All conditional formatting seems to be to colour a cell or text, but not to put a work in a cell… Thank you :)

Hi Lisa,

You are right, this is simple, and conditional formatting is not needed :)

Just enter the following formula into cell C5:

=IF(B5>100,"YES","NO")

Thank you so much! Now that makes sense! I have come across this before but must have completely forgot. Thanks again :)

Hi,

I have a workbook where I have work order numbers in column a and start dates in column f, in another sheet I have work order numbers in column d and start dates in column h. I need to be able to highlight a row if I have 2 different dates for the same work order number - Thank you so much

Hi!

Simply select the table where you want to highlight rows (without column headers), let's say in your sheet 1, and create a rule with this formula:

=$F2<>Sheet2!$H2

Where F2 is the top-left cell with dates in sheet 1, H2 - the top-left cell with dates in sheet 2, and Sheet2 - the 2nd sheet's name.

Hi Svetlana

Hope you can help. Would you know how I can apply conditional formatting to a table where the row colours alternate as the column value (text) changes?

For example: the column values are car, house, bird, table, anything else, and when the value changes, the row colour changes (2 colour choices). I can't apply a colour to each value as they are not all known. I just want two colours to alternate as the value changes so it's easy to spot the change.

Thanks in advance.

Pri

Hi Pri,

I believe this is the formula you need - How to alternate row colors based on a value change.

I hope this is not a "too late" comment: you can apply a new rule to the same range. The only condition is that you do not apply the same format for different values. Now: if you do not know what are the values (as they will be appearing appear in your table) you can have a list of new values and mark in your table any new item (not contained in your list) with a special color or mark. You can use a formula from LOOKUP or similar do detect if your table has or not the "new value" in your master list...

Thank you, Svetlana.

Very useful, although if you know a way I can run this without having to create an additional column that would be even more awesome! :)

Pri

Sorry Pri, I don't know such a way :( I can only suggest hiding that additional column.

Hello,

I have been working on a pivot table for receiving of parts for a specific product. Different parts for the product are received from different vendors. I am creating a file that will take raw data from sheet 2 and easily show and format the cells for each grouping of products when all the parts have been received.

For example, product 1 is listed 10 times in column A because it has 10 parts to it before it can be built. Column C shows if the part for the product has been received. What I would like to have done is once the report I paste into sheet 2 shows that all parts have been received for product 1 in column C, to then highlight the name "Product 1" in column A in green. I would also like this to repeat automatically for every other product in column A when all parts in column C are showing received.

Thanks for any help!

Hi Josh,

It looks like this can be done, but we need to see the structure of your data to be able to say with certainty and suggest a proper formula. If you send me your sample workbook at support@ablebits.com, we will try to help.

Hi,

Please help

I have 2 sheets. I have a list of items on 1st sheet, it has item code (A1) next to it is description (B2) and so on.

I am making sheet 2 with description only (populated from quickbooks). How do I make a formula to add the item code corresponding to its description on a cell next to it.

Not all items are in the 2 sheet and they are in different order compared to the 1st sheet

Thanks in advance

Hello Eric,

You can do this using a VLOOKUP formula similar to this:

=VLOOKUP($A2,Sheet1!B2:C20,2)

Where A is the column with descriptions in your Sheet2, B is the column with descriptions in Sheet1, and C is the item codes column in Sheet1. Please note that the VLOOKUP function cannot search on its left, therefore the Descriptions column (in Sheet1) should the the left-most column in your lookup range.

Please see the following tutorial for more info:

Excel VLOOKUP tutorial for beginners - syntax and formula examples

Advanced VLOOKUP formula examples

I am creating a scheduling template for a staff of hundreds of employees. I need to make sure I do not schedule an employee wore than 5 days in a given week. How can I highlight cells if a specific name occurs in a block of cells, say b7 - h15, more than 5 times?

Hi Brian,

Try creating a rule with this formula:

=COUNTIF($A$2:$A$20,A2)>5

Where A is the column containing the employees names and A2 is the first cell in a block with a given name. Please pay attention to the use of absolute and relative cell references.

=COUNTIF($B$7:$H$15,B7) >5

figured it out.

OK, here is a step further. Is there a way to highlight cells based off the same block of cells over multiple tabs. I tried "=COUNTIF('Batch Review:Rotary Opener'!$B$9:$H$28,B9)=1" and received and error saying that I could not use this reference in conditional formatting.

Hi Brian,

Conditional formatting rules require a more traditional formula format : ) Try out this one:

=(COUNTIF('Batch Review'!$B$9:$H$28,B9) + COUNTIF('Another sheet'!$B$9:$H$28,B9) + COUNTIF('Rotary Opener'!$B$9:$H$28,B9) ) = 1

Hello, I want to create a numeric series starting with 1 based on the value entered in a column.

For example:

In column d, row 7, the value entered is 3, then column e, will automatically enter number 1, 2, 3 to rows 7-9.

Then if I enter another value on column d, row 10 say for example 2, then column e will automatically enter 1 and to to rows 10 and 11.

Please help

I tried using this formula but then after it satisfies the first input value it will not do numeric series when inputing the next value

=IF(ROW(A1)<=$D$7, ROW(A1), "")

Hello!

And what values do you have in other cells of column D and why do you compare with A1? If you can send us a sample workbook at support@ablebits.com, it would be much easier for us to suggest a proper formula.

Hi Iam trying to enter a formula that returns the following

In cells in Column J I will be entering employee names against locations in Column K, I then need Column M to return programmed and the whole row to be highlighted in Green,

However if Column J returns RBS I need column M to return programmed but the row to be highlighted blue

Hi Simon,

I am sorry, I do not understand what "to return programmed" means and what RBS is. Can you please clarify?

Hi

What I would like to achieve is:-

I have 15 employees who work in different teams, I would like to set up a formula that when I type the employees name (ie C Reed) into cell K2 cell N2 is populated with the word Programmed and the entire row is highlighted in green, but if I typed RBS into cell K2 Cell N2 is still popultaed with Programmed but the row is highlighted in blue.

Thanks for helping

Hi Simon,

Thanks for the clarifications. Then you can try creating 2 rules with the following formulas:

Blue: =AND($K2="RBS",$N2="Programmed") This rule should be the first in the list, with the option "Stop if true" checked.

Green: =AND($K2<>"",$N2="Programmed")

Hi Sorry

I dont think I made it clear that if I typed RBS or my employees name in to cell K2 I would like the word Programmed to automaticaly appear in Cel N2 and the row to either highlight Blue if Cell K2 contained RBS or Green if an employees name is typed into cell K2

Thanks for your help

Hi Simon,

Just enter the below formula to cell N2, and then copy it across the entire column:

=if(K2<>"","Programmed","")

This formula will enter the word "Programmed" in column N once you type an employee name in column K in the same row.

And then, you can create the conditional formatting rules with the formulas I suggested earlier to color the cells in the way you want.

Hi

I have a case.If i type a text "IN" in cell A1, the next cell B1 should be blank.No other values could not be typed in that cell.in same way if a description is already in cell B1 and if I type text "IN" in cell A1 it should get automatically deleted.Pls help me out.

Hi David,

If column B already has any values, I think conditional formatting won't work. This task requires a macro and you can try to find an example on some Excel-targeted forums like mrexcel.com or excelforum.com. I am sorry for not being able to help you.

Hello I am working on a retirement planning spreadsheet. I have keyed in a started working age, and a retirement age of 67. I need help in creating a formula that stops the series at age 67. For example, If I key in age 26, in my table, my series goes to age 71 bc I orginally formatted the table to have a basic start age of 22. I would like to be able to create formula that stops the series at age 67 regardless of the age you start working.

Hi James,

Try nesting your current formula inside the IF function in this way:

=IF(A2<=67, YOURFORMULA, "")

Where A is the collumn with the current age, e.g. 22. Then А46 will have "68" and at this point the formula stops the series.

If the above approach does not work, please send us your sample workbook with the existing formula at support@ablebits.com, and we will try to figure this out.

Hi.. I have conditionally formatted a row of data to highlight the highest cost and lowest cost for a product (each cost in a different column - b,c,d,e).

How do I copy this format down to 1457 individual rows, without having to paste the format to each row individually?

Hi Jocelyn,

In conditional formatting rules, cell references are relative to the top-left most cell in the applied range.

So, simply select all 1457 rows, and create 2 rules with the below formulas (assuming that B2 is the top left-cell in the applied range):

=MAX($B2:$E2)=B2

=MIN($B2:$E2)=B2

Hi,

I'm trying to format 3 columns of data. Each row of these columns needs to be formatted based on 1 cell in that row. I am trying to format each row given 5 variables for that 1 cell. Is there a way I can do this?

Thank you.

Hi RW,

I believe this is possible. However, to be able to suggest a formula, I need to know a bit more about your data. If you can provide an example of what exactly values you have in each of the 3 columns and what condition you want to base the formatting on, I think I will be able to help better.

Thank you. It's for a fantasy football draft, so the 3 data columns are Player Name, Position, and Team.

I want to base the formatting on Position. So, if Position = QB it shades all 3 cells yellow. If Position = RB it shades them green... and so on.

Thanks for the details, now the task is crystal clear : ) You can achieve the desired result in this way:

- Select all the rows with data in those 3 columns, not including the column headers.

- Create conditional formatting rules with the below formulas, assuming that column B is the "Position" column and row 2 is the first row with data:

Yellow: =$B2="QB"

Green: =$B2="RB"

Hello-

So I am using Excel 2010 to keep a list of my exchange servers and all of the DBs at my company. I get a report mailed each morning and I take the values from those reports and import them into excel. From that data I create a bar graph using conditional formatting, but for some reasons the rules will not affect TWO CELLS. Only two. I have the rules setup to affect a range of cells from H6-H37. H10, and H20 simply do not respond to the rules I have configured. I have tried everything...re-writing the rules, I even specifically set the range as those cells individually and the rule still wouldn't affect them. Any ideas?

Thanks in advance for the help.

Where is this pulling my picture from? That is creepy...

Hello,

The picture is automatically pulled from gravatar.com (Globally Recognized Avatar).

Hello,

Most likely the problem is with the format of those 2 cells. You can try to copy the formal of some other cell where the rules are applied correctly using Excel's Format Painter. Did it help?

Also you can check the list of rules in the Manage Rules dialog to make sure there are no other rules set for those 2 cells that override your new rules.

hi

I hope you can help with what must be very simple, but I can't get to work and no one else seems to have asked the question anywhere(perhaps because it is so simple LOL)

I am keeping a record of electricity consumption by month. If for example the figure in B1(Jan 2014)is less than the figure in A1 (Jan 2013) I can conditionally format B1 to go green, but I can't for the life of me get B1 to remain clear if there is no figure in it. I'm guessing that a blank cell is less than any figure in A1? Is there a way to do it?

Many thanks

Steve

Hi Steve,

You are right, the solution is simple, though not obvious at first sight : ) You can achieve the desired result in 2 ways:

1. Use the following formula for column B:

=AND($B1<>"",$B1<$A1) The expression $B1<>"" checks whether a cell is not empty, and the AND formula applies the rule only if both conditions are met. 2. In addition to your current rule, create one more rule of the "Format only cells that contain" type > Cell value > Blanks for column B. Alternatively, you can create a rule based on this formula =$B1="", which also applies to blank cells only. Do not set any format for this rule. Finally, make sure this rule is the first in the list, and select the option "Stop if true" next to it.

Brilliant! thank you; option 1 worked perfectly. Thank you so much.

Steve

Is there a way to move a whole row to a new sheet based on the contents of one cell? I have a column titled "loan status" and it is either marked with a "C" (closed) or "O" (open). I would like all the closed loans to be moved to Sheet2 once I change the "loan status" to a "C". Thanks.

Hi Cathy,

Most likely, you need a special macro for this task. I am really sorry we can’t help you with this. Please look for a solution on these forums: http://www.mrexcel.com or http://www.excelforum.com

In one of my Columns I need to ensure that only 10 numbers are input. I would like the cell to turn yellow if any more or less characters are input. This will help to alleviate me having to track people down for corrections if they know immediately that they have input this number combination with to many or to few characters.

Hello Geoff,

I think you can create a rule with this formula

=OR(len($G2)<10,len($G2)>10)

Where G2 is the first cell in your column, not including headers.

Hi Svetlana,

I'm a novice at conditional formatting and need your help to create conditional formatting rules to change font colours of a date value in a specific cell dependant on that dates relation to the current date, for a equipment rental tracking spreadsheet. I need to create the following rules: where return date is current day 'red' and lastly when a date is entered actual return date cell (different cell) 'blue'.

Hi Kevin,

You can use the following formulas to create conditional formatting rules:

Red: =AND($F2="",$B2>=today())

Blue: =$F2<>""

Where $F2 is the first cell in the column "Actual return date"; and $B2 is the first cell in the column "Return date", not including the column headers.

You can apply the above rules to one or more columns or to the entire table. In the latter case, the whole rows will be highlighted.

Hi,

I regularly use conditional formatting, but for whatever reason the correct icon colours won't show right away for only a couple of cells.

But..as soon as I copy and paste the exact same values over itself, it works.

Or if I open the conditional formatting rules and go to edit it, and click in one of the "value" boxes (not changing any values) and click "Ok" and "Apply" it works.

Or if I highlight everything and unhide rows (even though no rows are hidden), it works.

I have checked the parameters a hundred times, and it all appears correct, but it's not showing the right icons until I do either of these three things.

Help?

Jeremy,

It is hard to say what can cause the problem without seeing your data. If possible, please send your workbook at support@ablebits.com and we will try to help.

Hi

What was the problem with this spreadsheet? I am having the same issue. The colour doesn't appear straight away but when i minimise the window and open it back up it appears okay.

Thanks

Kirsten

I should specify, I am using the conditional icon sets Green, Yellow and Red.

Thank you!

I am trying to find a way to incorporate conditional formatting into my behavior system in my school. Every time a student goes a week without having any behavior "marks" they get to move up a level. Is there a way to enter in the number of "marks" a student receives and anytime a zero is entered it changes colors. The hard part is that the second time they have a zero, I would like it to change a different color, as well as the third, fourth, fifth, and sixth time each different colors as well. Keeping in mind that the student may have zero marks one week, and then 4 marks the second week. Any assistance would be greatly appreciated! Thank you in advance for your time.

Hello Alisa,

Please specify whether you want the color to change for consecutive zeroes only, or they can be mixed with other numbers, e.g. 0, 0, 2, 0, 0.

If the latter, you can use the following formula:

=COUNTIF($B2:$F2,"0")=5

Where $B2:$F2 are the columns where you enter marks during the week, "=5" is the number of zero marks for a certain color.

THANK YOU! This was exactly what I wanted!

One other question for you. I applied this to the first row, but I have 100 students on this spreadsheet. How do I apply this to each row separately?

Thanks again!

Hi Alisa,

When creating a rule, just select all the rows to which the rule shall be applied. Then you write the formula for the first row, and Excel will automatically "recalculate" it for other rows.

You can change the existing rule by clicking Conditional Formatting > Manage Rules > "Applies to" field.

Thank you!

Hi

I have list of weeks like Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday. And have created a dropdown list for selecting any one. Have tried conditional formating to colour the selected week using lookup formula. But the same is not working even though the formula is correct.

Weeks are listed A1:A7 and dropdown list at B1, formula I used for conditional formating was =LOOKUP($B$1,$A$1:$A$7)=$B$1

Kindly help me with correct solution

Hi Mahabaleshwara,

Do I understand it right that you want to format a cell in the range A1:A7 that contains the same day of the week that is currently selected in the drop-down list in cell B1? If so, then simply select cells A1:A7 and create a rule with this formula:

=$A1=$B$1

As I explained in the article, in conditional formatting you write a formula for the top-left cell only and it gets applied to the entire range you've selected when creating a rule.

If you are looking for something different, please clarify.

Thanks Svetlana, but the questioned I originally asked seems to have been cut short, so I am listing again what I'm trying to achieve.

I need to have the cells in a specific column colour code according to the rules below:

- where return date is current date 'red' and lastly

- when a date is entered in the 'actual return date' cell (different cell)'blue'.

So assuming the 'return date' cell is B2 and the 'actual return date' cell is F2, can you please advise what the formulas would be for each rule listed above. Additionally, would I need to select 'use a formula to determine which cells to format'?

Many thanks, Kevin

Again my comment above has been cut short the rules I need to create formulas for, so I will list them again below:

- where return date is current date 'red' and lastly

- when a date is entered in the 'actual return date' cell (different cell) 'blue'.

The list of rules keeps getting cut short in each post, so listing them again below:

1. where return date is current date 'red' 4. when a date is entered in the 'actual return date' cell (different cell) 'blue'.

The comments in my post keep getting cut short and altered. Is there an email address I can send my list of rules I need to create formulas for?

Kevin,

Please email at alex@ablebits.com. If possible, please include a sample workbook with your data.

I will try to reply as soon as possible.

Svetlana,

Great blog.

I would love to find a simple answer to my question and would appreciate your help.

Two columns A & B

Column A has a numbers in it such as

1000-50-50-5060-508150-000000-000-522500- Total

6000-40-40-4030-409555-000000-998-522500- Total

6000-40-40-4040-401220-000000-999-522500- Total

6100-41-41-4110-411001-000000-004-522500- Total

6300-80-51-8070-807010-000000-000-522500- Total

Column B has a list of starting numbers such as

1000-

2300-

2600-

2702-

2750-

4001-

4022-

6000-

6067-

6100-

6161-

6200-

6261-

6300-

7100-

What i would like is for Column B and the cell "1000-" (and other numbers) to be red if there are numbers in column A that start with "1000-" and the other numbers. I only need color in Column B. It seems simple enough but I cannot find a way to do it. I hope that you can give me the solution.

Thanks.

Hi Steven,

Try creating a rule for column B with this formula (assuming that row 2 is your first row with data):

=COUNTIF($A2:$A10000,$B2&"*")>0

For more info about using the COUNTIF function, please see this article:

http://www.ablebits.com/office-addins-blog/2014/07/02/excel-countif-examples/

That was exactly what I was looking for. Thank you so much. This will help so much.

Hi Ma'am, what is the formula if the quantity of columnA is equal columnB then it highlights the rows if they are equal. ex. 10 rows, 1 row had equal quantity this rows must be fill in color. Thanks

I need a formula I could use that will help me calculate the average of a group cells in one column based on the condition of another column. For example, I want to find the average for data in column D based on data in column E, but the data in column E must only be >750 and <1001. HELP PLEASE!!!!

Hello TJ

For us to be able to assist you better, please send your sample workbook to alex@ablebits.com.

Great just to confirm I have noumerous list like

A B

1 3

1

3 5

4

etc. I want conditional formatting as follows

Format all cells in colum B if the respecting cell is NOT blank and if

the cell in column B is greater than the cell in column A

=AND(A1"",B1>A1). the question is how to applying to all the column using respective or absolute values

Hi Stratis,

You need absolute column references (since both columns are constant) and relative row references, like this:

If a cell in

column Ais not empty and if the cell in column B is greater than in column A:=AND($A1<>"",$B1>$A1)

If a cell in

column Bis not empty and if the cell in column B is greater than in column A:=AND($B1<>"",$B1>$A1)

You can lean more about proper use of absolute and relative cell references in conditional formatting rules in this tutorial:

http://www.ablebits.com/office-addins-blog/2014/08/07/relative-absolute-cell-references-excel-conditional-formatting/

I want a row to highlight if one cell in that row is not empty, I have chose the row and then in the formula typed =NOT(ISBLANK$I15) and it only highlights the A15 if I put something in I15. this works if I just want to highlight one cell in that row

Hello Patsy,

You can highlight the entire row if one or several cells in this row are blank using this formula:

=5-COUNTBLANK($A1:$E1)=1

Where 5 is the number of columns, and 1 is the min number of empty cells.

You can also use this simplified formula, where 4 is the difference between the 2 above mentioned numbers:

=COUNTBLANK($A1:$E1)=4

Thank you Svetlana for answering. I did not make myself clear. Column "I" is blank until a deposit is made and then I put a date there. When I put a date there someone else has to add data to our finance data system so I want it to highlight the entire row when I add something too Column "I" in order for them to see it at a glance. At first I was only highlighting one cell with the formula =NOT(ISBLANK$I15)). The other users felt like it would be easier to following if the complete line was highlighted.

Thanks everyone I found my answer after reading for two hours others problems, and I found someone that had a similar problem and I got it to work. Thanks

Patsy,

In this case, simply apply your existing rule to the entire table. Click Conditional Formatting > Manage rules, and change the range in the box under "Applies to".

Also, make sure all brackets are in place in your real formula, one is missing in the formula you posted here : )

Sir,

I have entered in first column category such OPEN,OBC,SC,ST etc then OPEN for 450, OBC for 250, SC for 100 without type the number in infornt of other col. automatically. How it is possible

Hi Kiran,

You can try using a VLOOKUP formula, as explained in this tutorial:

http://www.ablebits.com/office-addins-blog/2014/07/17/excel-vlookup-tutorial-beginner/

Hi

How to use the function INDEX and MATCH together.Is it better to use than Vlookup?

Hi David,

You can find the detailed answers to your questions in my recent article: INDEX & MATCH in Excel - a better alternative to VLOOKUP

Hope you'll find it helpful.

Hi

I am trying to highlight duplicate data in 1 column only if they data in the next column are also duplicated. How do I do that?

Thanks

Hi!

You will need to insert a helper column. Suppose, the original columns are A and B, and column H is the helper column.

- Type =A2&B2 into the cell H2 and copy the formula down column H.

- Select columns A & B and create the conditional formatting rule to highlight duplicates with this formula:

=COUNTIF($H$2:$H$100,$H2)>1

As an alternative, you can also use our Duplicate Remover add-in (the Color duplicates option) to highlight duplicates. In this case, you won't need a helper column.

Hi

I'm trying to create a conditional formatting rule, but nothing seems to be working, could you help.

If cell Z3 is equal to or greater than 25 I want cell C3 to be green, if Z3 is between 15 and 24 inclusive I want cell C3 to be orange, if Z3 is equal to or less than 14 I want cell C3 to be red.

I've managed to get simpler conditional formatting rules to work, but when I've gone to copy for the formula into other rows it wont work.

Any suggestions please?

Hello Emma,

Most likely, the problem is in using proper absolute / relative cell references in the formulas. You can find more information about different cell references types in this article: Relative and absolute cell references in conditional formatting rules.

If you need to compare values in each individual row, select all the rows you want to format and create 3 rules with the following formulas (assuming that row 3 is the first row where the formatting is applied):

Green: =$Z3>25

Orange: =AND($Z3>=15, $Z3<=24)

Red: =$Z3<=14

In case you want to format all the rows based on the value in cell Z3, use absolute cell references in the above formulas, i.e. $Z$3:

Green: =$Z$3>25

etc.

Hi

I'm trying to setup a conditional formatting with the icon sets and I need some help!

I've this situation:

B C D E

A1 Sell to 20 L

A2 Buy From 25

A3 Sell to 30 M

A4 Buy From 5

A5 Sell to 15 H

A6 Buy From 2

I've setup a conditional formatting check for A1B1 that says if there's an N,L,M,H change to appropriate color (easy!)

However in the A2B1 (and in every other cells) there's a number that I'd like to have compared to the every other cells that refers to the rows "Buy From" using the icon sets (bars value)

Is there a way to do this without manually select every other cells and apply the conditional check?

Also, once I've created the conditional formatting(s) for the column B1, can I copy paste its properties to the other columns by dragging the source column in my worksheet.

I hope I've explained my problem :-)

Hi Antoine,

Sure, you can apply your rule to other columns. Go to Conditional Formatting > Manage rules, and change the range in the box under "Applies to".

As for the icon sets, it is difficult to understand what data you have in the columns without formatting. Please send us your sample workbook to support@ablebits.com and we will try to help.

Hi Svetlana,

I am trying to set up conditional formatting rules to evaluate the following excel spreadsheet.

Actual value column to a Budget column value. Based on the Actual value column if it is 10% or less from budget value color yellow, if greater than 10% color red and if monthly value is equal to budget color green. I have set up 3 rules with Use formula to determine which cell to format, but it not doing what I want it to do?

Examples:

Rule 1 B5=C5 format green

Rule 2 B5>C5*.10 Format Red

I have tried using $B5 or $B$5 same results,

any suggestions in accomplishing this task so I can have the color's automatically filled in? Thank you!

Hi Shannon,

The rule with $B5 should work, assuming that row 5 is the first row in the applied range.

If it still does not, please verify the following:

- Make sure you entered the correct column names (B & C)

- Probably, the Green rule shall be applied when a monthly value is equal or _less than_ a budget: =$B5<=$C5

- In the Yellow & Red rules, you should multiply by 1.1, not by 0.1. (Red: =$B5>=$C5*1.1)

- Check if your numbers are formatted as numbers and not as text (they should be aligned to the right, without a green triangle in the top-left corner of the cells)

If none of the above suggestions work, please send me a sample workbook to support@ablebits.com and I will try to help.

Not sure if this can be done and I've tried a bunch of different ways to create a rule and keep coming up short. On my X axis I am using names. I know which names need to be in different colors. I cant seem to come up with the proper formula or rule to make this happen.The y axis which relates to $ has nothing to do with what I need the x axis to do so writing a rule to that end wont work. Any suggestions?

Hi Nique,

Did you try selecting the entire table and creating a rule similar with the below formula?

=A2="name" (where A2 is the left-most cell of the applied range)

If this is not the result you are looking for, please send me a sample workbook at support@ablebits.com and include the result you want to get.

Can I ask a question – trying to format a pivot table and highlight the last column where the value is under the avg – eg 57709 is below para – please highlight the “4”

Do you know any other way ? other than manually

Mark

57703 21 34 36 31 38 34 33 27 29 44 30 29 29 415

57709 4 5 2 6 2 2 4 1 5 180 4 215 21.1 4 -17.1

57712 25 20 21 23 28 32 25 17 30 17 27 24 28 317

57715 9 8 16 7 15 16 7 11 13 9 113 12 20 256 19.66667 20 0.333333

57901 1 1 1 2 3 1 3 2 2 1 1 5 2 25

Hi Mark,

I am sorry, I don't know a way to fulfill this task using conditional formatting formulas.

I found the reason my conditional formatting formula didn't work is that I used a lower case letter for the row label rather than upper case.

I have a similar problem that is not listed under your manual. I'm doing a sales analysis from period to period and I need to be able to tell when sales for a certian product either drop or go up by 15% all the sales figures are entered in percents as well.

Hi Bradley,

I am sorry, I can't make a proper formula without seeing your data. If possible, please send a sample workbook at support@ablebits.com and we'll try to help.

Hi Excel Gurus,

I want do following please help me how do I do this.

I have set of samples taken which about 300000 samples in a column.Now I want to calculate average of every 1000 samples.

Please help me how to do this calculationin EXCEL.

--Sameer

Hello Sameer,

Try pasting this formula in any cell of the second row:

=AVERAGE(INDIRECT("A"&((ROW()-2)*10000+1)&":A"&(ROW()-1)*10000))

Where A is your column with the data; -2 is the row number with the minus sign. Then copy the formula down to 30 cells.

Hi svetlana!

i m having problem in excel regarding below

assume i have a value which is 10 in cell A1 and 20 cell B1 so i want to calculate these 2 columns or in result i want answer value with Text include by single formula.

Suppose if i calculate through if condition e.g If(A1>B1,"increased by"A1-B1,"decressed by"A1-B1))

the answer should be like this ( Decreased by 5 )/(Increased by (value))

can u plz help me out of this??

i hope u`ll understand what mean 2 say??

Hi!

You were almost there : )

=IF(A1>B1,"Increased by "&(A1-B1),"Decressed by "&(B1-A1))

Is it possible to highlight only duplicate rows that are consecutive in order? Only duplicates on consecutive rows need to be highlighted. The field that is being compared is a text field -- a name.

Thanks for any direction you can give me.

Hi Sherry,

You can highlight consecutive dupes by creating a rule in this way:

- Select the column where you want to highlight duplicates, without the column header.

- Create a conditional formatting rule using this formula:

=$A1=$A2

Where A is the column with your data, $A1 - the column header, and $A2 – the first cell with data.

I am having an issue with Conditional Formatting. What I have is A3:I8 and I want to fill in all cells when cell B3 is blank. I have tried everything I can think of and nothing has worked. What would be the best way to accomplish this task?

Hi svetlana! well thanks it was really worked it out.

Hmmm...well svetlana can u tell me plz frm where i can learn advance Excel and VBA through online ??? so i can check the solutions by my self...??

Thanks 1nce again..

Hi Adam,

Simply select the range A3:I8 and create the rule with this formula: =$B$3=""

I'm trying to setup conditional formatting as follows:

Say Column A are dates that deliveries were scheduled e.g. 08/27/2014

I want the conditional format of Column B to show just the scheduled month and year; for example the date in cell A1 (08/27/2014) should appear as Aug-14 in cell B1.

Can someone provide the type of conditional formatting I should apply to Column B so that no matter the date in Column A, Column B will show that Month and year??

I creating a macros and this is the final piece to the puzzle. Please and thank you in advance!

- Lacy

Hi Lacy,

I think conditional format is not needed for this task. You can enter the formula =A1 in B1, then copy it across the entire column B, and then set the format mmm-yy for column B (Format cells > Number > Custom).

I am trying to highlight duplicate rows only where the duplicated information is on a consecutive row. The duplicated information is a text field -- two letter state abbreviations. Any ideas how to do this with a text field?

Hi Sherry and Crosbi,

Recently we've received several such questions and I thought we should add an example to the tutorial. Please check it out:

How to highlight consecutive duplicates in Excel

Hopefully this is the solution you are looking for.

hi, i'm looking for a formula to highlight cells in a pivot if cell value is >= 20 and at least 4 consecutive cells. help! thank you.

Hello Shawna,

Please have look at this article about using conditional formatting in PivotTables:

http://www.ablebits.com/office-addins-blog/2011/05/23/excel-conditional-formatting-pivottables/

If you need to highlight cells with the value greater than 20 and if the values of the three preceding cells are greater than 20 as well, then select all the data (they should be in the 4th row or below) and enter this formula:

=AND($B5>=20,$B4>=20,$B3>=20,$B2>=20)=true

Where B is the column with your data, B5 is the first cell with the data.

Hi,

i want to know is there any formula to get freez (desire)coloum i.e.

like if A1=1 than any one able to enter the value or text on G1

if A1=0 than no one able to enter value or text on G1

kindly help if you know

Hello Arun,

I am sorry, I don't know the way to fulfill this task using conditional formatting, a special macro is needed for this.

Hi,

Thanks a lots for your reply

is there any reference for same?

if yes than kindly share with me

i want to do conditional formatting based on another cell value.

for ex:

if cell(A6)= N, the formate of c8:p20 should be defined format,

like that for different value of a6 the formate of c8:p20(defined formate) should change

may i know how to do it

A B C

149 86 554

if less than value is 86 then who can we highlight B in another cell

Hi All,

I have two cells data as

A10 : if(a = b)

B10 : if((a = b) && (b = c))

I want the cell C10 to be

c10: if((a = b) && (b = c)), the extra chaecters are to be displayed in Bold RED colour.

Please help

My query is on conditional formatting with dates.

I have a s/s which has the following columns:

1. Date Contract sent out

2. Date Signed contract returned (blank until it is returned)

3. 7 days reminder

4. 14 day reminder

5. 21 day reminder

If column 2 is blank, the highlight (I have this part done)

If column 2 is blank and 7 days have elapsed since date in column 1 then format cell green

If column 2 is blank and 14 days have elapsed since date in column 1 then format cell orange

If column 2 is blank and 21 days have elapsed since date in column 1 then format cell red

Thanks

Hi Svetlana,

Great and very informative post.

In a large range A1:AK100, I need to highlight the first cell (A:A)in a row if ALL cells in the rest of the row are blanks. Please note that all cells contain formulas that either return a value or "".

Thanks

HI madaam,

I want to create formula that when I input letter on a cell, ex. L on b5 then

b6 will have letter v.

i used coding in java, Excel - Using formula(String formula = "SUM(Vouchers!E2 : Vouchers!E"+(rec+1)+")";) to reference values on other sheets(Vouchers) get 0 only, i directly apply this formula in excel sheet, got 86123.67, but reference to other sheet got answer of #Value, why this happen?

Hi there,

thank you for the great text. i recently downloaded an spreadsheet from excel built-in template called "Gantt project planner". I was wondering have you seen that file, I couldn't figure out how it used special formatting. If you can't find it. please let me know to explain more. anyway, I copied them in the following,

Actual =(PeriodInActual*(project!$E14>0))*PeriodInPlan

ActualBeyond =PeriodInActual*(project!$E15>0)

PercentComplete =PercentCompleteBeyond*PeriodInPlan

PercentCompleteBeyond =(project!BY$8=MEDIAN(project!BY$8,project!$E17,project!$E17+project!$F17)*(project!$E17>0))*((project!BY$80)

PeriodInActual =project!BY$8=MEDIAN(project!BY$8,project!$E19,project!$E19+project!$F19-1)

PeriodInPlan =project!BY$8=MEDIAN(project!BY$8,project!$C20,project!$C20+project!$D20-1)

Thank you very much if let me know how these formulas work for conditional formatting.

I wanted to utilize conditional formatting to highlight cells that are 90 days away from a certain date. Then if it passes that certain date to become red. Can someone please help?

I would like to use conditional formatting for multiple cells based on date. There are pending, completed and "blank" cells. I also need to create a tally based on the updated cells by location (I was thinking i could link the cell to a certain area within the sheet or even create a new sheet. I have six locations and I want to have the table "updated" automatically once a milestone has been completed? How can I do all of this for one sheet?

Thank you! I need all the help i can get.

Hi Svetlana,

I have a question related to the similar topic. Would you be able to advise if a cell can be formatted/ formulated based on the value of a range of data in a row?

E.g. A row of data has been conditioned formatted to highlight the highest numerical value as bold blue while the rest which are not the highest numbers are in default black colour.

In a separate cell, if I were to key in the highest value or other value, can the cell be formatted to show what is exactly in the range of data which was conditioned formatted earlier?

Thanks a million!

Hi Svetlana,

Could you please help with the below conditional formatting

I have a product (orange)

I have Stock on Hand (SOH)of 95Kg (CellD2) and I have and order for today of 45Kg (F2)and tomorrow 40Kg (G2).

Then I have a stock on order (SOO) of 100Kg (E2)

What I need is:

Highlight my orders in yellow when my SOH cover the QTY ordered then

Highlight my orders in red when my SOO cover the rest of my orders

Ultimately no highlighted cells if SOH and SOO doesn't cover my orders

Below example:

The 95Kg of SOH cover 24 and 25 of September with 10Kg left over

With my SOO of 100Kg plus the 10 left from SOH, (110Kg)cover the 26 but not the 27

Therefore (24 and 25) should be yellow, 26 should be red, 27 no highlight

Can you help

DC Article Description SOH SOO 24/9 25/9 26/9 27/9

656 369558 Oranges 95 100 45 40 56 75

Hello Michael,

You can use the following formula to create the "yellow" rule:

=SUM($F2:F2)<=$D$2

Also, make sure the "Stop if true" checkbox is selected for the "Yellow" rule in the rules' list.

The "red" rule should look as follows:

=SUM($F2:F2)<=($D2+$E2)

Wonderful tutorial!! Thank you so much!!

Thanks. This tutorial is brilliant. I used it to color my bank statement xls. It helps identify the Debit and Credit transactions in just a glance.

=$D13="DR"

Color Red for

=$E$13:$E$50

Hi, Good morning

Can you please help me with my formatting problem.

I have an work sheet with several column. I need to format a column based on the other column. eg; column B will be Appreciated IF column A says Positive Behaviour.

Thanks in advance

Glenn

Hello Glenn,

Conditional formatting is not needed for this task. Simply put the following formula in cell B1 and then copy it down column B:

=IF(A1="Positive Behaviour","Appreciated","")

If your data starts, say, in row 2, then replace A1 with A2 and copy the formula in B2.

And if column B is appreciated column D will be the same date as column C.

Thank you

Glenn

Hi Glenn,

Here is the formula for cell D1:

=IF(B1="Appreciated",C1,"")

Hi Svetlana,

THANK YOU very much

It's really a BIG help for me...

Helo,

Again I want to ask for your help...

I have spread sheet and I need a sum up.just like this

if value in column A was duplicated the value in column B and C in that row will automatically sum up.

Thank you

Hello,

Good morning,I already figure it out last night.

Thank you very much

Very nice blog!

I have a list (top to bottom) of let's say 100 customers, and their monthly sales (so Jan-Dec, right to left).

For each customer (ie, each line) I want to use Conditional Formatting to highlight each customer's best 3 months.

I can certainly do conditional formatting on each of the 100 lines, one by one, but that is extremely burdensome. Is there some way to highlight all 100 lines and all 12 months and have excel know to do it line by line and not just pick the three best results out of the whole range (1,200 cells)?

Thank you VERY MUCH!

kept looking and found the answer on another site:

Highlight the entire area (all columns and rows with data); manage rules; create new rule, where A1 is first cell and O is last column:

=A1>=LARGE($A1:$O1,3)

Perfect! :)

So I am creating my own budget sheet for uni, and I have almost done it. I am just stuck with one problem.

Based on my grant, I have £11.52 a day on average. This is £80.64 a month. To make sure I don't overspend (as we get a lump slum every 3 months) I am basing the budget on a day to day format.

My problem is, Say I spend £10 on the first day, this leaves £1.52. This money can then be split over the 6 other days meaning I would have £11.77. However, I can not find a formula that will allow me to do this. Say I spent £6.00 on my first day of the week. I would then have £12.10 for the other 6 days. Then if I continued to under spend, My daily budget would increase.

It currently looks like:

Date Daily Amount Spent

02 October 2014 £11.52 £0.00

03 October 2014 £11.52 £0.00

04 October 2014 £11.52 £0.00

05 October 2014 £11.52 £0.00

06 October 2014 £11.52 £0.00

07 October 2014 £11.52 £0.00

08 October 2014 £11.52 £0.00

Total Left £80.64 £0.00

Any answers anyone

Hello Adam,

You can deduct actual expenses from the weekly budget, then divide by the number of remaining days and you'll get your budget for a day. If you send your sample workbook at support@ablebits.com, I believe we'll be able to write a proper formula.

This blog has been very informative, but I have not found an example of my problem yet. I simply want to highlight duplicates (preferably not the first occurrence) only when the values in two other columns match. In other words, I would like to find duplicates in column C only when the values in columns A and B are the same.

I've tried countifs formulas, but they are not working. I wonder if I need to use a match statement or something similar. Any advice would be greatly appreciated.

Many thanks.

I read over my comment and realized that it may be unclear that I want values WITHIN columns A and B to match, not match each other (for which I found an example). For example, duplicates would be highlighted in column C when values in column A = 1 and values in column B = 2, then duplicate searching would start new when values in either column A or B change.

Thanks again.

Hello Raineek,

If my understanding is correct, you want to highlight C3 if any of the above cells contain the same value and if A3 is equal to B3.

If so, select the column C starting from C2 till the end of the table and enter this formula:

=AND($A2=$B2,COUNTIF($C$2:$C2,$C2)>1)

So, I have been continuing to work on this problem and I have the correct formula to highlight duplicates in a column if values within 2 other columns match. For example...

=COUNTIFS($B:$B,$B2,$E:$E,$E2,$J:$J,$J2)>1

However, I am having a hard time to avoid highlighting the first instance in this case with multiple columns.

I would also like to have a separate column that has a formula resulting in a "0" value when it is the first or only instance of a value in column J, only when the values within B and E columns match. Right now, based on something I found that explains how to do this in one column, I've tried to modify to include multiple columns like this formula...

=IF(COUNTIFS($B:$B,$B2,$E:$E,$E2,$J:$J,$J2)>1,0,NOT(COUNTIF($J$2:J2,J2)=1)),but I don't think it is dealing with the multiple columns well.

Again, advice on this would be appreciated.

Thanks!

Raineek,

I'm not sure I can completely follow you. If you need to highlight duplicates rows by comparing rows by several columns and highlight only the second and further occurrences, this can be dome using VBA or our Duplicate Remover add-in. Sorry, I don’t know a way to do this using Excel formulas.

My query is on conditional formatting with dates.

I have a spread sheet which has the following columns:

1. Todays date $B$1

2. Date entered for return of document $AJ4 lets say 3/10/2014

If column 2 has the date 3/10/2014 then highlight 30 days prior in red.

Thanks

Hello Jean,

I am sorry, it is not very clear how column 2 and $AJ4 are related. If you can send a sample workbook to support@ablebits.com, we will try to help.

I am trying to conditionally format an entire column based on the information from another column. For example, I want to highlight red in B1 a value less than that of A1. It will be green when greater than A1. I also want to highlight red in B2 when it is less than A2, green when greater than. So each value in column B needs to be highlighted with its corresponding A value. I just do not want to have to do this line by line for 50 items. Is there a way to do this all at once?

Hello Woody,

Of course, there is no need to create a rule for each row. You simply select all the cells in column B that you want to highlight, say B1:B50, and create 2 rules with the following formulas:

Red: $B1<$A1

Geeen: $B1>$A1

Since you use the absolute column (with $) but relative row (w/o $) references, Excel will adapt the formulas for each indibidual row and highlight cells in column B as you need.

I have duplicate values in Column B, and I would like to have the entire rows highlighted when a duplicate value is found in Column B only. Similar values may also be found in Column A, but I only want the duplicates from Column B to be considered when highlighting the entire row. How would I accomplish this? Thank you!

Hello Susan,

Simply select all the columns and create a rule using this formula:

=countif($B:$B,$B2)>1

Perfect - thank you SO MUCH! Have a great day!

Awesome thread, thanks a lot! Even though I didn't ask a question, my doubt got solved :)

Hi Susan...Hopefully this isnt something that Ive missed, but I am needing advice.

I am using conditional fomatting to format an entire row if column G contains a conveying document type (eg. WD, TD..)

I higlighted the table, used:

=$G1="WD"

It worked great!!

My question is, I want it to be the same color for WD, TD, Exec Deed,...etc. Is there a way to have all these words in one rule? Or do I have to make a new rule for each word?

Thanks!!

Hi!

Of course, you can have them all in one rule by using the OR formula like this:

=OR($G1="WD",$G1="TD",$G1="Exec Deed")

Svetlana,

Is there a way to make the color associated with a conditional formatting rule dynamic?

For example can I feed a value in cell A, a color in cell B, and make the conditional formatting formula's 'format' in cell C depend on the value of A but if true to present the background color indicated in B?

Thanks!

Hi Svetlana,

I am trying to have any cells in Column Q that have an equal value as any cells in Columns A and B be formatted; with the values in Columns A and B continuously changing. I've only been able to input a successful formula that highlights equal values that are only within the same row. Thanks.

Hi Svetlana,

I am trying to get cells in a column to equal a value of 1 with numbers in the cells that could be 1-50,but the value of each cell still is counted as 1 so that I can get them to sum up at the end. Thanks.

Hi Bobby,

If my understanding is correct, you need to count the cells in a certain column with values from 1 to 50, inclusive.

If so, I can see 2 possible ways:

1. Use the following COUNIFS formula:

=COUNTIFS(A1:A10,">=1", A1:A10,"<=50")

Where A1:A10 is your range of cells.

2. Add a helper column with the following formula next to your column with numbers:

=IF($A1>=1,IF($A1<=50,1,""),"")

It will populate a cell in the helper column with "1" if a cell in the same row in column A is between 1 and 50. Then simply use Excel's AutoSum to count 1's.

Dear Svetlana,

I want to use formula or conditional formatting for below mentioned condition:

If i enter a date in one cell of column A and missed to enter some data in other cell of column B then color of cell of column B need to appear Red, and vice versa...

Please reply ...

Little Urgents..

Regards

Shubham

Hello Shubham,

You can create two rules as follows (assuming that row 2 is your first row with data):

For column A: =AND($B2<>"",$A2="")

For column B: =AND($A2><"", $B2="")

Hi Svetlana,

Suggested formula works .....Thanks a lot.

Could you please explain the logic behind as i have tried similar things but didn't succeeded earlier...

Thanks a lot for the solution, you deserve a treat from my side..:-)

Shubham,

I will try. The logic is actually pretty simple : )

For column A:

- You use the AND function to set 2 conditions.

- Condition 1 - a cell in column B is not empty: $B2<>"" (<> means "is not equal to", "" - no value)

- Condition 2 - a cell in column A is empty: $A2=""

The rule for column B is analogous.

An absolute column reference ($A - with the dollar sign) and relative row reference (2- w/o the dollar sign) tell Excel to adjust the formula for each individual row.

Hope this makes sense.

This would be a lot easier if I could show you a picture, but here goes. For example, I want my cells to turn different colors based on the text inside them. So if the cell reads "apple" I want that cell to fill with the color red. If it reads "orange" I want the fill to be orange and so on. The cells I want to be automatically colored will not be in one column, but between 3.

Thank you for the help in advance and I look forward to your reply!

Christopher,

Simply select the range of cells you want to color depending on their values, e.g. A2:C100, and create a separate rule for each word:

Red: =A2="apple"

Orange: =A2="orange"

Where A2 is the top-left cell of the selected range.

I am working in Excel 2007. I need to know how to reference conditional format of a cell based on another cells value in a different sheet. Essentially, I want the color of a cell on sheet 1 to change too red, green, or yellow based on a percent delta on sheet 2. The percent delta could change and if it goes up, I need the cell to turn red, down to green, and same is yellow.

I saw on a video that someone was able to do this by selecting the cell in the formatting rule, but my excel says, “You cannot use references to other worksheets or workbooks for Conditional Formatting criteria.” when I try.

Thanks in advance!!

Good Evening Svetlana,

I emailed you my spreadsheet earlier.

I am trying to use conditional formatting with the stop light icon sets. I was able to get one to work.

What I really need is for the parameters to be set based on the text from another cell.

Ex.

C3 says "Other", this could also say HC or MF.

Opportunity Analysis (OAS)

Name YRC

Vertical HC/MF/OTHER

OtherActual Total number of locations 400

Number of "Open Market" locations 300

Number of "Franchised" locations 100

Shared Savings Fee % 45%

Annual Waste Spend - Total 3,800,000

Annual Waste Spend - Open Market 2,850,000

Estimate % savings 20%

$ savings (open market) 570,000

Cass annual fee 256,500

Cass net monthly fee 21,375

Fee per location per month

71MFStop LightEst. Fee per location per month > 85

Proceed with caution 75 - 84

Stop - See VP of Sales < 75

HCStop LightEst. Fee per location per month > 125

Proceed with caution 115 - 124

Stop - See VP of Sales < 115

OtherStop LightEst. Fee per location per month > 85

Proceed with caution 75 - 84

Stop - See VP of Sales < 75

Based on the parameters above, how can I use conditional formatting in C14 to be dependent on which word has been typed in C3?

C14 currently holds the value 71 that was derived from a sum function =SUM(C12/C5)/12. C14 currently has a red background with a red light, but is not using C3 to base its rules off of. The rule is only coming from =$C$14. How can I get the parameters to apply "if C3 is this word" "then these rules would apply to C14"?

Thank you for any knowledge you can spare.

Monique

Hi Svetlana,

I want to use conditional formatting for monthly office time sheet. It has Time in and Time out column. I want to change the color of Time in column to change to yellow color if it exceeds 10:00 am.

Looking forward for your response.

Regards,

Ajay Verma

Hi Svetlana,

I want to use conditional formatting for monthly office time sheet. It has Time in and Time out column. I want to change the color of Time in column to change automatically to yellow color if it exceeds 10:00 am.

Looking forward for your response.

Regards,

Ajay Verma

I need some help. I want to add values In column c where column d equals a term i.e account and display it in a cell on top.

C5 2 d5 account

C6 5 d6 boo

c7 2 d7 account

=4

But I need a way to search the whole column as a range because I am adding new rows daily

Hi there,

I have a table with 10 rows, 10 columns and another table as a bingo ticket (which has 3 rows and 9 columns, with 5 numbers on each row, randomnly distributed).

What I want to do is, if I enter a number (between 1 and 100) in my first table, the cell with a matching number in the bingo ticket will switch to a preformatted colour.

How can you do that ? I have tried with lookup and index functions, but without any success... :-(

Finally, I found it...

In the ticket table all the cells will have a colour formatting based on:

Formula is =COUNTIF(first_table;cell)

Hi Svetlana. Thanks for your very interesting postings !

I want to use conditional format to highligh cells in a row when there is an "X" filled in in that row; this works with the formula =ISNUMBER(MATCH("X";$B2:$M2;0))

Now I want to add a rule that only the cells before the "X" and the "X" itself are highlighted, but NOT the cells after the first "X" in the row.

Could you help ?

Thanks in advance,

Hilde

Hi Hilde,

Try modifying your formula a bit by removing the $ sign from B2, like this:

=ISNUMBER(MATCH("X";B2:$M2;0))

I want to apply conditional formatting to underline whenever there is a new customer. The spreadsheet is sorted to group customer orders together in rows. Each order is in one row and the customer name is in column B. I want to take it a step further and apply this to a macro for daily application to daily orders which may range from 60 rows to 500 rows.

Please help.

Hello Debbie,

And what is the indication of a new customer?

Hello,

I need a little help on what I think is a fairly easy formula, I am just having trouble finding exactly what I want.

If the date in C23, let's say it's 10/22/14, is between TODAY()-30 and TODAY()+30 then I want cell D23 to be filled red if it is still blank within that time frame.

Basically my spreadsheet will be tracking due dates in column C I have the date the document is due and in column D I have when someone turns in their document to me. So I want to be able to track if it is due in the next 30 days or up to 30 days late, if the date is between -30Today+30 and the cell in column D is still blank I want it to be filled red.

Hopefully that is clear enough. Thank you.

Hello Keriann,

This is crystal clear, thank you : )

Select cells in column D you want to color excluding the column header if any, and create a rule with this formula:

=AND($C2>=TODAY()-30,$C2<=TODAY()+30,$D2="")

Assuming that row 2 is your first row with data.

I'm trying to use conditional formatting to highlight a cell in a column red if the value of the cell is > 150% of the average of the values in the column. I've tried and tried,but nothing I have tried works. Can you please help?

Hi Brian,

Try creating a rule with this formula:

=A2>AVERAGE(A2:A20)*1.5

Where A2 is your first cell with data.

Hello,

I'm trying to configure an "and" statement - I think.

I have a number of upcoming "jobs", all down column A. For each job, there are a number of "tasks", all across line 3. When a task for each job is completed, I simply put an x in the corresponding box.

My jobs all have a different start dates, and as of right now I have the estimated start date in column C. When the upcoming job starts within in 2 weeks, it highlights the cell orange using =AND(C4-TODAY()>=0,C4-TODAY()<=14). When a job has started, it highlights the cell red using =C4<TODAY().

Is there any way I can double-conditional format, where if a job is coming up within two weeks and some of the tasks for that job have not been completed, it will highlight that cell? Same with once a job has started. Thank you very much.

Hello Susan,

If my understanding is correct, you have each task in a separate column, say columns D-F. And you want to highlight a job that is coming within the next 2 weeks if _at least one_ task column is not filled with "X".

If so, you just need to embed the OR statement in your formula, like this:

=AND($C4-TODAY()>=0, $C4-TODAY()<=14, OR($D4<>"X",$E4<>"X",$F4<>"X"))

Svetlana,

Nice Work!

I want to know if is it possible to change the color of a cell when rollover another cell?

For example: if I get my mouse over the cell A1, the cell B4 change its color.

Thanks in advance.

Thank you, Carlos.

Unfortunately, I don't know the way to fulfill your task using a formula or a VBA macro. Really sorry.

Select a value from a drop down, then that selected drop down value (flags) changes a cells color on a different sheet depending on value selected from drop down.

Hello Jason,

Sorry, I don't exactly understand your task. Please describe in more detail what you want to get.

Hi Svetlana,

I have a data table and column Q is drop down list of an application status. Column P is populated with some values. My requirement is if a specific drop down value is selected from Col Q the corresponding col P value should become zero.

I have tried conditional formatting but it is throwing up circular reference issues. Can you please help?

Also, I have always admired the name Svetlana!!

Hello Subha,

It is not possible to change values in cells using conditional formatting.

You can enter the following formula in Cell, say P2, that will populate it with 0 once "Value1" is selected in cell Q2, otherwise, cell P2 will be empty.

=IF(Q2="Value1", 0, "")

If you want to change the current value in column P based on the section in your drop-down list, then a special VBA macro is needed.

Reference: 120 80 Diagnosis

Measured: Systolic Dialatic Systolic Dialatic

Patient 1 111 75

Patient 2 105 75

Patient 3 104 80

Patient 4 126 86

Patient 5 120 69

Rule: Measured blood pressure -

- can be lower than the reference by 10 (0~10 lower are OK);

- can be higher within 5 (0~5 higher are OK)

- 11 ore more lower is diagnosed as "Lo BP"

- 6 or more higher is "Hi BP"

So the words "Hi" or "Low" wil lbe displayed

in the range of D6:E10

I need a formula for systolic using a Rule: Can you help me please

Hello Liana,

Shall we check these criteria "11 ore more lower" and "higher within 5" against both Systolic and Dialatic? Or "11 ore more lower" applies to Systolic and "higher within 5" applies to Dialatic? Also, in what columns do you have Systolic and Dialatic numbers of your patients and in what cells you have the corresponding reference numbers?

Hi team ,

i need to format a cell if another cell contain Yes ,

A1 contain Yes

Now I need to apply conditional formatting on B2 if A1 contain "Yes"

Hello Musadiq,

This is very easy. Simply select cell B2 and create a rule with the formula =A1="yes"

Drawing a blank.

If I want to set a condition format with an icon set where I get a "check mark" for zero and and "x" for anything greater than zero.

Seems very simple but I am not wrapping my head around it at the moment.

Hi Ben,

I have experimented a bit, and the following settings seem to work fine. Under Conditional formatting, click Icon Sets > More Rules and then set up:

X when values is >o (type - number)

"check mark" when <=o and >=0 (type - number)

X when when <o (type - number) (X will also appear for values less than zero, if any; or you can choose any other icon for this).

Hope this helps.

A really good post. Thanks.

I have a spreadsheet with about 5000 rows. One of the columns is "File Status" that is filled with either a "A" (for active) or "C" (for closed). Is there a way to move a whole row based on that column to a new worksheet. Ideally, we would work from the worksheet with all the "A" files and when we close the file, we change the "A" to a "C" and the whole row could be moved to the sheet for Closed files. Also, if we reopen a file, is there a way to put on the Closed sheet a formula to move "A" files back to the original sheet?

How can I set a conditional format, that will highlight a cell that changes in value upon refreshing its data load?

Hi,

I need to edit / fill cells if a certain cell in the row contains 'Yes' or 'No' with the contents of cells from another sheet.

For example,

On Sheet1, If B2 = 'Yes' then I need B3,B4,B5 and B6 to contain the information from cells B3,B4,B5 and B6 from sheet2.

And on sheet1, if B2 = 'No' then I need B3,B4,B5 and B6 to contain the information from cells B3,B4,B5 and B6 from sheet3.

How do I manage this, I have been trying all day!

Thank you in advance for any help you can give.

I am attempting to write a conditional format that allows me to see when the value in one cell is larger than another, then shade the larger cell darker as the difference becomes greater.

A1 = 95

A2 = 96

In the above example, A2 is larger and would become filled with a color,the difference is 1. But if the difference were 5 (A2 = 100) then I would want cell A2 to fill a darker shade.

I tried using standard deviation and color scales, but because there are only 2 number being compared, it does not seem to work the way I had hoped.

Thank you for any advice you may have!

Gary

Hello Gary,

I am sorry, I don't know a way to fulfill your task using Color Scales. As an alternative, you can try creating several rules based on formulas:

=AND(A2-A1>=0, A2-A1<=2)

=AND(A2-A1>=2, A2-A1<=5)

=AND(A2-A1>=5, A2-A1<=10)

Hi,

I was having the same issue and I manage to solve it using Color Scales. :)

Try the following:

- Select the range (a1:a2 in your example) and enter in the Conditional formating > New Rule > Format all cells based on their values

- Select 3-Color Scale

- In the "Minimum", select Type "Formula" and write the following formula: "=MIN($A$1:$A$2;1)"

- Let the Midpoint with the percentile

- In the "Maximum", select Type "Formula" and write the following formula: "=MAX($A$1:$A$2;100)"

The further the diference between the values of the cells, considering a potential maximum of 100 and minimum of 1, the darker de cell color.

Hope this helps.

Cheers.

Hi Svetlana

Great source of information. I came across it searching for a solution to a problem I have. In one column (say column 'A') I have a list of activities that need to be completed. In another column (say column 'B') I enter the percentage of the task in column 'A' that has been completed. I would like the first column to be filled with a data bar based on the percentage that has been entered in column 'B'. Probably dead easy but I can't figure it out. Be really great if you can help.

Thanks

Shaun

Hi Shaun,

Unfortunately, it is not possible to fulfill your task using Data bar, or at least we don't know how. Data bar works only with the information in the same cell.

The only alternative we can suggest is to insert a helper column to the left or to the right of column A, enter the formula =$C2 there and copy it down to other cells. Then you can apply a conditional formatting rule to this column by selecting the Data Bar format style and turning on the "Show bar only" option.

Hi

I am trying to figure out a formula that will identify the same number within a column, and within that range compare the sums of 2 other columns to see if they are equal, with an output of anything ("same", colour whatever) or to just be left alone if the sums don't add up.

Example:

Invoice # Dr Cr

111 14 0

111 0 12

111 0 2

222 4 0

222 0 3

would result in

SOMETHING

SOMETHING

SOMETHING

222 4 0

222 0 3

Is this possible?

I have over 26,000 lines of data that need to be identified by an invoice # if the Dr don't equal the Cr...please tell me there is a way!!

Hi,

I need to edit / fill cells if a certain cell in the row contains 'Yes' or 'No' with the contents of cells from another sheet.

For example,

On Sheet1, If B2 = 'Yes' then I need B3,B4,B5 and B6 to contain the information from cells B3,B4,B5 and B6 from sheet2.

And on sheet1, if B2 = 'No' then I need B3,B4,B5 and B6 to contain the information from cells B3,B4,B5 and B6 from sheet3.

How do I manage this, I have been trying all day!

Thank you in advance for any help you can give...

Hi,

For this task, you need a usual IF function rather than conditional formatting. For example, these are the formulas for cell B3:

=IF(B2="yes",Sheet2!B3,"")

=IF(B2="no",Sheet3!B3,"")

I have a pivot with conditional formatting. I now need to add more columns of data to the pivot. When I do that the column references called out in the conditional formatting don't change and I lose the formatting.Is there a way to do this without losing the formatting?

Hello Alex,

I am sorry, it is difficult to recommend anything without seeing your data. If you can send your sample workbook to support@ablebits.com pointing out the column you want to add, our support team will try to help.

Hi, I want to apply conditional formatting for "not equal to" clause. The cell is getting highlighted if I choose from the provided options like equal, greater than but not getting highlighted if I manually enter a formula for not equal to. Im using this formula : =$D25490

Thanks !

$D25490

Hi!

This formula does not look correct (maybe was distorted when publishing). Anyway, if you can specify what exactly cell(s) you want to highlight and based on what exactly condition (not equal to a certain number or another cell?), I think I will be able to suggest the right formula.

The not equal to operator did not get published! Anyways, I have a column named cost code under which I want to highlight all the values which are not equal to 5490.

Our blog engine often cuts off the "not equal to operator" in comments, argh! Anyway, your formula (=$D2<>5490) is correct. Just make sure you are selecting the entire cost code column (without the column header!) when creating the rule, and row 2 is your first row with data.

If the rule still does not work for you, you can send me your sample worksheet (support@ablebits.com) and we'll try to figure this thing out.

Hi,

Can you help me please?

If cell A1 = 1, I want the maximum value in the range B1:B5 to be highlighted red. If cell A1 doesn't = 1 then no conditional formatting needs to take place.

Any ideas?

This worked:

Select range B1:B5.

Conditional Formatting > New Rule.

>Format only cells that contain.

Cell Value > equal to > =IF($A$1=1,MAX($B$1:$B$5))

Format > Fill > Red.

Hello Andy,

Select the cells B1:B5 and create a rule using this formula:

=AND($A$1=1,Max($B$1:$B$5)=B5)

The techniques you outlined work great unless you have data in merged cells. My "applied to" cells are merged. It appears that the formatting chosen in the merge dominates the conditional formatting. If I set up my conditional formatting, then double click in the cell, I can see the result of the conditional format, however as soon as I leave the cell, the formatting is gone. Any way to remedy this?

Hi,

I have a formula for my sheet with vlookup..for ex:In the cell A2 if i type "Apple" than the rest of the cells in the row gets filled up automatically like B2 with "fruit"

C2 with"Red".But if SOMEONE TRIES TO CHANGE THE FORMULA for ex.. enter something other than the "fruit" in B2 or other than "Red" in C2 the color of the particular cell should change to red and No fill when they change the values back to formula...

Thank you very much in advance!

HI,

I have a spreadsheet for cashflow that tracks down my everyday expenses. On another tab, i have a consolidated tracker that includes my businesses and investments. The problem is i keep on substituting a certain entry in the consolidated tracker because i dont know how to reflect the latest cash i have base on the cash flow tab as of the current date. Here is the example:

Cell A Cell B

20Nov14 $500

21Nov14 $400

22Nov14 $350

23Nov14 $100

cash as of today: ????

I wanted excel to always pickup the cash based on the current date. Let's say today is 23Nov14.

Thanks,

Ben

Hi Ben,

Please clarify what exactly result you want to get: expenses for 23-Nov-14 ($100), a sum for the previous days in November or something else?

Is it possible to include multiple conditions using both AND and OR operators in the formula for conditional formatting. Can you please provide a syntax for this.?

Thank you in advance!

Hello Ahamed,

Of course, it is possible. One an AND function can be one of the conditions in the OR function and vice versa. For example:

=AND(B1=2,OR(C1=3,C1=4))

=OR(AND(B1=2,C1=3),C1=5)

HI,

I want to color a cell based on another cell value.

if cell D1 contains "false" I want to get red color in cell A1.

How can i do that?

Thanks

Nazmul

Hi Nazmul,

If FALSE is entered in D1 as a logical value (Boolean), then you can create a rule for cell A1 (or multiple cells in column A) with the formula: =D1=false

If you have "false" as a usual text, then enclose it in double quotes in the formula:

=D1="false"

Hi Svetlana,

Thanks..it works.

I have another problem. I want to change a row color for a cell value of those row..How can I do that?

Nazmul

Hi Nazmul,

Simply select entire rows and create a conditional formatting rule using the same formula.

hi

if i have two dates on one cell. i need to change the color if the send date added

i mean 2nd date added

Hello

If I want to write a conditional formatting that for example it should find for me if the fifth number in a certain cell is 0 then make the cell red

12340

or1,2340

how do I write it

Hi there,

I don't know if you can help me but it's worth a try! I am looking for a conditional formatting formula that will help me do the following...

If cell A1 is a colour (i.e. determined by conditional formatting rules) then make another cell the same colour without changing the original function in the second cell.

Thanks!

Ian.

Sir,

I am having spreadsheet containing D cell value K cell value , what is the formula for if K value is not equal to D cell value ?

Please reply.

K.R. Ranganath

Hi Ranganath,

Assuming that row 2 is your first row with date, here's the formula:

=K2<>D2

if i have one date, that date is smaller than other date. for this which formula i can use

Hello,

I am trying to format a cell if it is greater than another cell. Basically if the result is greater than the criteria?

Criteria Results

0.7 0.220 0.213 0.555 3.240

5 0.800 0.064 0.324 0.585

Any help on why this formula isnt working??

=AND(ISNUMBER(B2),ISNUMBER($A2),B2>$A2)

Where Cell A is the criteria and B is the result

Thanks,

Hi Svetlana

I am trying to change the cell colour of rows based on the change in value. Similar to Subtotal.... for each change in column B....

so if I have

1

1

1

2

3

3

3

3

I would like the colour for Rows 1 - 3 to be red, then white for 4th row then red for row 5 - 8

Is it possible?

Thanks

Hi Svetlana, Great blog here!

I think my problem is quite simple, and may have been covered in earlier examples but I am still unclear through trying!?

I have a value of "Yes" or "No" in Column F, and want to colour this column/these cells based on a date in the same row, Column D:

Amber: If 30 days overdue i.e. <NOW()-30

Red: If 60 days overdue i.e. <NOW()-60

Can you help??

Many thanks!

Ashley

...oops forgot to say, I wish to colour it when it says "Yes". "No" should be left unformatted

Hi Ashley,

You can combine these 2 conditions using the AND function, like this:

Red: =AND(TODAY()-$D2>60, $F2="yes")

Amber: =AND(TODAY()-$D2>30, $F2="yes")

Please note that the Red rule shall come first in the list of rules.

Great, that works a treat. Thank you for your timely help :)

How do I conditionally format a table so that in column J when the word "Complete" is entered it highlights rows C to J in green?

Hi Svetlana,

I am trying to do conditional formatting of email addresses to quickly identify addresses from gmail, hotmail, and yahoo. After a lot of looking online, I found a formula I could use:

=NOT(ISERR(SEARCH(Sheet2!$A1:$A3,A1)))

(Sheet 2 A1 - A3 are: A1= gmail.com, A2= hotmail.com, A3 = yahoo.com)

However, when I put this in my conditional formatting - it only highlights those addresses with gmail in them and ignores the rest. I'm not sure what I am doing wrong. Any ideas?

-Michael

Hi Michael,

The point is that you have an array formula and array formulas can't be used in conditional formatting rules. In your case, the formula turns into =NOT(ISERR(SEARCH(Sheet2!$A1,A1))) and highlights only gmail addresses.

You can pick the domain name in a row and use the MATCH function to find matches in your lookup table using the following formula:

=MATCH(IFERROR(RIGHT(A1,LEN(A1)-FIND("@",A1)),""),Sheet2!$A$1:$A$3,0)>=1

You rock my world. Remind to me buy you a beer if we ever meet. :)

Hi..

I want to change a entire row color for a cell value of the row... If i have 'fail' in a certain cell (D1) then i want to highlight row 1. How can I do that?

Hi Nazmul,

Simply select all the rows you want to highlight and create a rule with this formula:

=$D1="fail"

Hi Svetlana,

Thanks a lot..it works..

I have text from a drop down list (NO and YES) in Cell B2 that I want to use as the basis for conditional formatting elsewhere in the spreadsheet (to color a number of cells in a certain row red), but the formula (=$b2="YES") does not seem to recognize the text - if I insert the text manually rather than use the drop down list it works just fine. Any suggestions?

Thank you.

Please help me, I have a spreadsheet,eg A1:P245, I would like to be able to do is delete/clear any cells that contains a particular text.

For example the cells may contain the following data

P1abc P1gvh p2erg P3fgh sro34 sro56 srj67

How do I clear the cell that start with P

How do i clear the cells that contains ro

Thanks you.

Is it possible to give a colum like "stable" or "ascending" the directional icons?

Like if stays "stable" then must be ↔ and for "ascending" ↑.

I i want use now the directional icons, i must give a number. I want in text.

I solved this problem with using VLookup

Hi there,

I'm trying to compare column A with a table, for example column B and if there is a match the match should be colored. Column B contains a output that had several decimals. The match does not need to be exact, ideally I would like to scan for a range of about +/-0.5 of column B. Does anyone have a suggestion how to approach this?

ColumnA ColumnB ColumnC

Output1 Output2 Addition to column B

260,1 201,123 b2

262,1 242,105 y4-NH3+2

330,2 250,618 y4+2

338,1 269,161 y2

351,1 306,134 y5-H2O+2

372,1 306,625 y5-NH3+2

372,8 315,139 y5+2

416,1 320,197 a3

418,1 330,181 b3-H2O

348,192 b3

370,655 y6-H2O+2

371,147 y6-NH3+2

372,170 y3

379,660 y6+2

417,213 a4-NH3

427,197 y7-H2O+2

427,689 y7-NH3+2

434,240 a4

436,202 y7+2

444,224 b4-H2O

For example 330.2 matches 330,181 (with addition b3-H2O)and so they should be filled in with red. 372.1 matches with 372,170 and thus y3, the should be colored orange etc.

Look forward to any help,

Thanks, regards,

G

Output 1 Output 2 Addition to column B

260,1 201,123 b2

262,1 242,105 y4-NH3+2

330,2 250,618 y4+2

338,1 269,161 y2

351,1 306,134 y5-H2O+2

372,1 306,625 y5-NH3+2

372,8 315,139 y5+2

416,1 320,197 a3

418,1 330,181 b3-H2O

348,192 b3

370,655 y6-H2O+2

371,147 y6-NH3+2

372,170 y3

379,660 y6+2

417,213 a4-NH3

427,197 y7-H2O+2

427,689 y7-NH3+2

434,240 a4

436,202 y7+2

444,224 b4-H2O

Hmm the table didn't come out as it supposed to..

Output 1 Output 2 Addition to column B

260,1 201,123 b2

262,1 242,105 y4-NH3+2

330,2 250,618 y4+2

338,1 269,161 y2

351,1 306,134 y5-H2O+2

372,1 306,625 y5-NH3+2

372,8 315,139 y5+2

416,1 320,197 a3

418,1 330,181 b3-H2O

348,192 b3

370,655 y6-H2O+2

371,147 y6-NH3+2

372,170 y3

379,660 y6+2

417,213 a4-NH3

427,197 y7-H2O+2

427,689 y7-NH3+2

434,240 a4

436,202 y7+2

444,224 b4-H2O

Oops the table didn't appear as it should be..

Oops the table didn't appear as supposed;

Output 1 Output 2 Addition to column B

260,1 201,123 b2

262,1 242,105 y4-NH3+2

330,2 250,618 y4+2

338,1 269,161 y2

351,1 306,134 y5-H2O+2

372,1 306,625 y5-NH3+2

372,8 315,139 y5+2

416,1 320,197 a3

418,1 330,181 b3-H2O

348,192 b3

370,655 y6-H2O+2

371,147 y6-NH3+2

372,170 y3

379,660 y6+2

417,213 a4-NH3

427,197 y7-H2O+2

427,689 y7-NH3+2

434,240 a4

436,202 y7+2

444,224 b4-H2O

Hi,

I want to format a column of percentages, dependent on the column of percentages to the left of them.

Highlight in green if the value is between 2% and -2%

Highlight in amber if the value is between 2% and 4%, and -2% and -4%

Highlight in red if the value is above 4%, or below -4%

I'm sure this is easy, but i cannot get my head round it. I think it could be to do with how the rules are ordered in the manage rules section, but not sure.

Thanks.

Hi,

I want to format a column of cells to fill in depending on when a specified date in another column has passed. For example I input the date into column "b" and then Seven days after that date has passed, I want Columns D,E,F to fill green. I am having trouble creating a formula depending on a date, any help offered would be appreciated.

Thanks!

Hello,

I have a workbook in excel and I want to know what article/type/value which is clicked or typed frequently in excel. But, I don't know how. can you help me?

Thanks :)

Hello,

I have a workbook in excel and I want to know what article/type/value which is clicked or typed frequently in excel. But, I don't know how. can you help me?

Thanks :)

Oops the table didn't appear as it should be...

in my worksheet, i have two columns, one is alphabet (column B) and the other one is numeric (Column C).

my condition is:

if column B is L, then column C should be 1

if column B is V, then column C should be 2

if column B is T, then column C should be 3

I WANT TO SATISFY THIS THREE CONDITIONS IN A SINGLE FORMULA, IS IT POSSIBLE?

PLS GUIDE ME

I'm using Excel 2013. I have not found a solution to this problem. I have a spreadsheet with 100 rows. The values in column P are numbers that are independent of each other. They range in value from 1.00 to 60.00. The values in column O range from 0.00 up to the value in column P for that row. I want to have each cell in column O in my worksheet use a red-yellow-green color scale conditional format, where the low value is zero, the middle value is one-half the value in column P for that row, and the high value is the value in column P for that row. I can create this conditional format for any one row easy enough. I can't find any way to copy it to the other 99 rows because the cell references in the color scale conditional format need to be absolute. It would be a lot of manual work to create this conditional format for each row one at a time. Is there a lower-effort mechanism available to do this?

Hi, thanks for the helpful posts. Though I am struggling with the following:

I want to color column B depending on column A. And result columns (say E to X) should be dependent on B (it's like a matrix of column B). My guess is I mix up relative and absolute cell-links. Or I don't get how to copy the rule for a cell to others, i.e. I can create the rule for a single cell, but not the full column.

A B ... E F G .... X

Positive 44 =B1 =B2 =B3 ....

Positive 43 =B13 =B14 =B15 ....

Negative 40

Positive 50

Uncertain 42

Positive 49

Negative 20

.... ...

Very greatfull for any tips or solutions.

sorry, formatting went wrong, hope you can read it

for every space there should be a tab.

Hi, I am a bit desperate here... I have searched everywhere but I can't find a solution to my problem. I really hope you can help me! So here it is:

My issue is with the conditional formatting using a formula. To summarize, I want G3 to be highlighted if F3 is more than or equal to 0 and also G3 is smaller than 90% of F3.

This is the formula I have entered in the conditional formatting but it doesn't work:

="AND($F3>=0, $G3<$F3*0.9)"

Thanks for your help in advance :)

Nevermind! I Figured it out. It should have looked like this:

=AND($F3>=0, $G3<($F3*0.9))

I am such a noob :P

Hi,

Pls help me with this.

Sheet 1 has to be a summary sheet that shows the consolidated values of # of open positions at onsite/offshore and for a particular month in sheet 2.

Sheet1 resultant table should be something like this

Status Dec-14 Jan-15 Feb-15

ON|OFF ON|OFF ON|OFF

Open 1 2 2 4 0 2

Selected 0 2 1 1 2 3

Identified 1 0 0 1 0 0

Sheet2 values will be like this

Name Status Location Start date

X Open ONSITE JAn-15

Y Open Offshore FEB-15

Z Selected Offshore Dec-14

XX Identified Onsite Dec-14

YY Selected Offshore Feb-15

Pls help me

Hi Svetlana,

I am trying to enter a formula that will color a row based on the values on two sheets matching. If I have a series of telephone numbers on one sheet and I have sheet with phone numbers on a second sheet, I want to highlight the row on the first sheet that has a matching phone number. I want to do this for the complete sheet.

So far I have managed to highlight the matching cells on sheet 1 using the following formula:

=COUNTIF('Sheet 2'!$D$2:$D$71,D2)

with a format to color the cell yellow applied.

That will obviously only highlight a cell if a matching number is found on sheet 2. I need to be able to color the row.

Thanks

Hi,

How can i make a calender in excel using formula (except using visual basic)?

Hi Svetlana.

My problem would not appear to be too difficult but I cannot find a way to make this work.

I am working on a rota for staff. In cell 1 I have a time 8:00:00 which is the start time. In cell 2 I have a finish time of 16:00:00 which i want to highlight in red using conditional formatting if the start time is = to 8:00:00. I'm sure this is easy but I'm stumped!

hi

I need to conditionally format a cell based on the conditional formatting of three other cells.

for example

A1 is Green

A2 is Green

A3 is Red

so I want A4 to show as Amber

Is this possible and if so how do I do it?

Thanks in advance

Amber

Hi Svetlana,

I need help searching a range of cells for information that may be contained in another spreadsheet. I have two spreadsheets which contain information for hundreds of entities, one for 2013-2014 members and another for 2014-2015 members. What I would like to do is identify new members by searching the Tax IDs in both sheets. If the Tax ID is found on both sheets, I would like it to do nothing. If a new Tax ID is identified on the 2014-2015 sheet, I would like it to highlight red.

Thank you in advance!

Jen

I want to color red a particular set of data if it contains data which is in a particular column using conditional formatting. what formulae should i use. i am not able to give an array in the formulae

can somebody help to solve this for me please? In excel 2013 I have a column where I have put some values.

e.g. In D1 cell and I want to give conditional formatting to E1 cell that it becomes red in background if the value in D1 is less then 50% and it becomes Yellow in background if the value in D1 is greater then 49% and it becomes Green in background if the value is equal to 100%.

Note: E Column I want to keep empty for the specific color as explained above.

Thank you in advance for your support. Regards,

Hi ,

I have a question, in my case 1 particular cell say A1 is done with a conditional color formatting so that the color of the cell changes with the value input in it. What I want is that the same cell color should be done for another cell say A2.

Could you please advise.Thanks

I am trying to highlight entire row based on a cell value

Wxample: I want my formula to highlight entire row where cell value = MH000038, when I am giving the below formula excel is not considering the zeros it is removing

Rule created = $C2=MH000038

Excel converting it to =$C2=MH38 so no cells are highlighting

any help will be appreciated.

Hi Suma,

Simply enclose the cell value in quotes so that Excel interprets it as a text string, like this:

=$C2="MH000038"

I would like to create a conditional formatting rule for the following:

Cell C2: If cell C1=36 then the text in C2 would be 3x/8 weeks, 2x/6 weeks (36)

Once that is completed, I'd like to create additional conditional formatting rules for the same cell.

Is that possible?

Hi Npratt,

I'm not sure I exactly understand the condition. Assuming that you want to put the text 3x/8 weeks in cell C2 if C1 euqals 36, otherwise - 2x/6 weeks (36), here is the formula for cell C2:

=IF(C1=36, "3x/8 weeks", "2x/6 weeks (36)")

Good day!

Hope you can help, as I tried everything and nothing works:

I have two columns (Sales in 2013 in one columns, and sales in 2014 in another column - this is made depending on customer). Now I have to figure out, from a glance, which customer bought more in 2014, which less

Column A B C

Sales in 2013 Sales in 2014

Purchaser 1 2131442,93 1783657,38

Purchaser 2 295638,22 2609,31

Purchaser 3 1733348,19 865579,68

Purchaser 4 1472991,01 418399,35

Purchaser 5 1490602,99 120403,99

Purchaser 6 2927921,82 2729046,74

Purchaser 7 452169,39 392953,53

THank you for your help.

Hello!

Simple request. I have had trouble finding the proper way to do this. I want to be able to enter a name in a cell on Sheet 1 of the MS Excel Workbook (2010) and have that same name (or data) repeated in a corresponding cell on another Sheet in the same workbook as I enter it in the one place. Basically I need names of associates to appear in multiple places, but only want to enter it once. Any tips?

Hello,

I'm currently using 2 sheets to keep track of client information. sheet 1 (client info) has columns listed as A1-SSN, B1-Lastname, C1-Firstname, D1-Phone#, and E1-paid (which is blank since the service occurs before payment) and each column has about 100 entries of the information. Now in sheet 2 (payments) I have the same columns listed in the 1st row and a vlookup formula in all the cells so that when I enter the SSN number in A2, the rest of the 2 row fills in with the names, numbers, etc. My question is how do I make it that when I enter 'yes' under the payment column (E2), my sheet 1 with also fill in 'yes' in column E for the right client?

Thank you for any help you can give

Hello,

I have a problem of replacing a cell value if th background color of the cell is Yellow: for example

Column A B

1 2

1 2

I would like in a new sheet to put in (column A) 1 or 2 depends on the Yellow color in A1 and B1,

so if A1 is highlighted in Yellow then put in the new sheet A1 code 1 if not then put 2

How I do that?

Hello,

I am trying to run down a large list full of one's and zero's. If it is zero, then the corresponding row, 2 rows to the left, value I do not care about. If it is a one, I then want to essentially add it to a mixing pot with all of the other values that have 1 corresponding with them, then find the max value of all of them. HELP!?

Hi Will,

I understand that you have a list of 0s and 1s but I'm not sure I understand the task. Can you please try to describe it in the following way:

-if cell A1 is 0, then do what?

- if Cell A1 is 1, then do what?

hi

tanx for your most useful tips

I have a question

I wanna write formula that says if you search a number in column b by Crtl+f

and it finds it the near column (column a) type ok and it change the color of it automatically...

is it possible anyway?

Hi Svetlana, I'm having a problem trying to find if the numbers in a column are in a sequence or not.

I want to highlight a cell whenever the it is not equal to the cell above it + 1.

So:

2

3

4

2 <-- HIGHLIGHT

5 <-- HIGHLIGHT

6

8 <-- HIGHLIGHT

Thank you for your help

I want to use the conditional formatting to color a column of cells based on "yes" or "no" in another cell. I tried walking through the steps above and got nothing. I also tried formatting it as a table and using the COUNTIF equation. I got it to work on a test cell but when I tried to duplicate it with the entire column I got nothing.

Hi, I want to conditional formating rows based off of what is in two different columns

Column1 Column2

1 NG

2 NG

1 OK

3 NG

2 NG

4 OK

I have it set up right now that if its OK it hightlights the row gray and if NG it shows orange. I want to make it that if another entry is entered and it is OK but the first time it is NG it will change the row to gray. So for the example the first row 1 is orange because of NG but when you add in the second 1 with OK it will change the first row 1 to gray also.

Thanks for the help!!

I would like to change my text value in column E and F based on the text entered into any cell in column F.

For example: If I enter in any cell in column F "BBL" I would like the "BBL" in column F to be red as well as any text I enter in column E but only in that specific row. I would like this formatting to work for the entire spreadsheet.

Hi there..

Been stuck with my project already.

I have a value in column A.

And i need to apply a 3-color scale on column B depending on the value of column A.

Condition:

If column A=<1 - column B turns red

if column A=the value of column A - column B turns dirty white

i think this is simple but im getting invalid formula.

why's that? this is what i've been doing

on column B3, i enter this

=$A$3=<1

=$A$3=$A$3

Hi,

I am in desperate need of some help with something if possible.

I am trying to conditionally format cells in a column (E, range 3-96) to:

-turn black if the cell next to it in column D is blank and the cell in column E is also blank.

-turn orange if the cell next to it in column D is blank but the cell in column E contains a time.

Any ideas?

Thanks in advance!

Hi there..

Been stuck with my project already.

I have a value in column A.

And i need to apply a 3-color scale on column B depending on the value of column A.

Condition:

If column A=<1 - column B turns red

if column A= the value of A - column B turns dirty white

i think this is simple but im getting invalid formula.

why's that? this is what i've been doing

on column B3, i enter this

=$A$3=<1

=$A$3=$A$3

sorry for the double post. it changed.

Hi there..

Been stuck with my project already.

I have a value in column A.

And i need to apply a 3-color scale on column B depending on the value of column A.

Condition:

If column A=<1 - column B turns red

if column A=<the half of A - column B turns yellow

if column A= the value of A - column B turns dirty white

i think this is simple but im getting invalid formula.

why's that? this is what i've been doing

on column B3, i enter this

=$A$3=$A$3

conditional formatting for cell B1- if cell A1=Optimize and B1 is greater than 0, red (or whatever)

A1 B1

Optimize 1

Use this Formula

=AND($B1>0, $A1="Optimize")

Select B1 Column.

This is a great list of conditional formatting uses! I have one I would like to see if you can tackle. I would like to highlight a range of values (item numbers) for a list of specific item numbers that qualify. The list may be small or it may be quite large. Would I need to do an OR function for each of the items in the list or is there a simpler way to get this done? Thanks!

GREAT columb. More insightful than the videos. Thanks.

please help me

I have this problem ( I create a conditional formatting to cell $I$2 (((cell value - less than - =$H$2-$H$2*10% )))

is there away to create a conditional formatting to all cell below depend on the right cell like this

(((cell value - less than - =$H$3-$H$3*10% ))) to cell $I$3

(((cell value - less than - =$H$4-$H$4*10% ))) to cell $I$4

(((cell value - less than - =$H$5-$H$5*10% ))) to cell $I$5

Hi,

Greetings.

in condition formatting check the cell value, if it is true assigned zero in another cell how?

Please kindly send the formula

Thanks

Ali Ahammad.

I am using MS Excel 2010. I want to use conditional formatting for B8 to B21 ( Format only Top-Green and Bottom-Red ranked values ) excluding 0.

hi,

i have this check list with a checkbox, and i need to know how i can make the question status cell to display a text(done, pending) while changing the cell color (red to green),when i select one of the checkbox answer.

ex. do you have a list of traces on PCB? []yes []no []n/a [question status]

I am trying to figure how to format the first cell in each row so that it will change to a color when all the cells are populated within that row (columns A-R). Some of the cells have text, some have numbers, and some have both. I am wanting to do this so that I know which rows are complete, without having to scroll back and forth and visualizing each one.

Each month the number of rows I have varies, so it may be 90 one month, it may be 130 another. The first row is a title/header row. The first column is populated with names. Any ideas?

Thanks!

Hello Christine,

Select the column A (from A2 till the end) and create a conditional formatting rule using this formula:

=COUNTBLANK($B2:$R2)=0

Hi, I've setup a training spreadsheet and added conditional formatting so that the cell turns red if the expiry date has passed (but only if the cell contains a value.

=IF((AND(K11<TODAY(),K11"")),TRUE,FALSE)

Trying to setup an additional rule that turns it yellow if that expiry date comes within 2 months of the current date but not sure on the details of the formula. i thought something like this maybe but its not working.

=IF((AND(K11<TODAY+60(),K11"")),TRUE,FALSE)

Any help would be greatly appreciated.

Thanks

Hi Steven,

The formula is correct except that parentheses should be after TODAY(), not after 60. Please try this one:

=IF(AND(K11<TODAY()+60, K11<>""),TRUE,FALSE)

So if i want color fill in other cells by follow the date that i am input, How can i setup the formatting formulas?

Hi. This is a very helpful article. I am having difficulty solving this. I have a table where every cell is a formula. Some are straight references to cells, "=C2", and some are vlookups, "=VLOOKUP(C2,...)".

I would like to highlight the cell only if the formula is a vlookup. Everything I see indicates that the conditions refer to the calculated values not the formulas themselves. I cannot use ISFORMULA() since all cells have formulas.

I appreciate any help.

Hello Curt,

If you use Excel 2013, then you are lucky. To fulfill your task, just select the table and create a rule using this formula:

=ISERROR(SEARCH("vlookup(",FORMULATEXT(A2)))=FALSE

Where A2 is the top-left cell in the selection.

If you have Excel 2010 or earlier, then you need to replace FORMULATEXT with VBA user-defined function (UDF)

Function formulatext2(cellSrc As Range)

formulatext2 = cellSrc.Formula

End Function

If you are not quite familiar with VBA, please see how to add a VBA macro (UDF) to your worksheet here:

https://www.ablebits.com/office-addins-blog/2013/12/06/add-run-vba-macro-excel/

Replace FORMULATEXT with FORMULATEXT2 correspondingly:

=ISERROR(SEARCH("vlookup(",FORMULATEXT2(A2)))=FALSE

I appreciate the quick and helpful reply. I do have Excel 2013 and your solution worked perfectly. Unfortunately, my client uses Excel 2010 and will not allow vba in the workbook I am creating. So I am back to square one. If you have other suggestions I would be anxious to try them.

Thanks.

I am sorry, but I don’t have any other suggestions.

Hi Svetlana, Thanks for this article, it's very helpful. I just wanted to ask you how to highlight one empty cell in a column (say "B") when other cell(s) (one or more, say "A" & "C") in the same raw is filled with some values. And the highlight remains until the cell in "B" is filled with some values. Is that possible? your reply will be very helpful and is highly appreciated. Thanks in advance..

Hello John,

Select column B and create a rule using this formula:

=AND($B2="",$C2<>"",$A2<>"")

Hello Alexander,

Thank you very much for the formula, this is the exact one which I've been looking for. It really works !!! Thank you once again for your time for helping me...

Hi Svetlana,

A very happy new year to you!!

Please can you help on below query.

Date From Organisation Details/Requirements Sent to Report Status

10/02/2015 Pending

14/02/2015

A is a date column that records the email receive date and F shows the status pending.

Now i want F to turn "pending" word in red if it crosses 5 days from date in A column. Please can you advise if i can conditional format it and how.

Thanks,

Rachana

Hello Rachana,

Please select your column F from F2 to the end and then create a conditional formatting rule using the following formula:

=AND($F2="pending",$A2+5

I have two columns, column A has various dates entered, column B has a formula =A1+30 meaning I want to see a date that is 30 days past the date in column A. I would like to add a conditional format to highlight the cells in column B when they have reached that 30 day mark. How do I do that?

Hello Betty,

Select column B and create a rule using the formula below to mark only today's date:

=B1=today()

If you need to mark today and past dates, then please use this formula:

=B1<=today()

I am wanting to conditionally format case sensitive values. For example, I want upper case "F" to be in green text and lower case "f" to be in blue text. I am using Excel 2010 and so far have not been able to google-cure my problem. Can you help?

Hello Sarah,

Please use the Exact function and create two rules using these formulas:

Green: =EXACT(H8, "F")

Blue: =EXACT(H8, "f")

Alexander, thank you for the help. I discovered that my problem was not related to the formula (as I had tried the one you gave above) but that in place of the cell number I was putting in the full array of cells i wanted the formula applied to. I should have left it as exactly the formula you have above and then applied that formula to the array of cells, not actually include the array of cell names in the formula.... if you get what i mean.

Thanks for your help!!!

Hi

I am trying to show icons for what I would think would be a simple task but I can't seem to make it work.

In column "N" I have a current rate percentage. In column "O" I have a target rate percentage. I want to use the icons to show a green check if the target has been met, a yellow exclamation point if the target has not been met, and a red stop light if the current rate is 50% or more below the target rate. Basically just showing which rates have been met, are almost there, and are in danger of not being met.

Can anyone help with this?

Thanks,

Heather

Hi Heather,

If you're content with just using color indicators instead of icons, the following should help:

***Please note, I'm using Office 2007, so this answer may vary depending upon which version you're using.***

Assuming your data starts on row 2 (N2 & O2 in the example you describe; perhaps because you have a column header title), you should be able to get the appropriate colors to show by entering the following formulas into the Conditional Formatting -> "Use a formula to determine which cells to format" in this order:

1) =$N2 Fill -> Background Color to RED)

2) =$N2 Fill -> Background Color to YELLOW)

3) =$O2 Fill -> Background Color to GREEN)

Unfortunately, it'll take me a bit more time to figure out the solution using the icons you requested. I'm actually at work right now, was on this blog searching for an answer to a question of my own, ran across your question & figured I may be of service within a reasonable amount of time.

I hope that helps.

Best regards,

Randy

Hi again Heather,

I see that the equations I typed got messed up (not sure why), so I'm going to attempt to type these again, this time with spaces between items. Please note that the other info remains the same.

1) = $N2 < $O2 / 2

2) = $N2 < $O2

3) = $O2 <= $N2

Best regards,

Randy

Thank you Randy! I will give that a try. My boss had her heart set on using the specific icons instead of colors, however I think I have convinced her that it just doesn't seem possible. :)

Sorry for the delayed response, been in training.

Heather

Hi,

In Cell M4 I need to calculate whether a particular price (which is in another tab called pricing matrix)should be shown dependent on the figures in cell range C3:I52 (if these cells are zero value then the price in M4 is zero.

However if there is a Y in any cell within the range K5:K52 then the price in M4 should be shown. I have inputted the below formula which sort of works however the cell M4 has lost the formatting for currency and decimal places. I have tried conditional formatting (I am no pro!) to no avail.

CONCATENATE(IF(SUM(C3:I52)>0,'Pricing Matrix'!D26,0)&IF(K5="Y",'Pricing Matrix'!$D$26,0))

Please help!

Many thanks

Catherine

Can someone help me with this conditional formatting problem?

I have a spreadsheet as follows:

Col A Col B

10 74%

9 72%

8 70%

7 68%

6 66%

5 64%

4 62%

3 60%

2 57%

1 54%

Raw Score 57%

Rating 2

In general, how can I highlight the specific cell in Column B where it corresponds to the Rating of 2 (in Column A and reported in cell B13)?

In this example I want to highlight the cell containing 57% in Column B since it corresponds with the Rating of 2 in Column A (and reported in cell B13).

Thanks.

Hello Alan,

Select the range from B2 till B11 and create a conditional formatting rule using this formula:

=$A2=$B$13

Hi there I need solution for

If cell A10 = any value

Then cell A11 = 345 (fixed value)

Any 1 can help?

Hi!

I have a problem with conditional formatting. I have columns A and B.

Row; Column A ; Column B

1; -0,87 ; -0,96

2; -0,57 ; -0,23

3; -0,66 ; -0,65

4; -0,74 ; -0,76

...

300; -0,78 ; -0,87

I have altogether 300 rows and two columns with changing values. I would like to highlight the values in Column B in green or red whether the value is greater than or less the value in Column A at same row that the value of Column B is. I know it is possible to manually create the rule for each cell separately, but I have 300 (!!!) rows. Can the rule be copied to other cells so that the reference changes like the rows change (Column B3 refers to value in Column A3 and B5 to A5 etc.)? So I don't have to create the rule for each cell separately.

Thanks in advance!

Hi Svetlana,

I have a table in excel. The cells in the table contain formula. When I click on one cell(say cell B2) how can I get those cells in the table highlighted where the values are greater than equal to {59/(clicked cell value)}.

I am trying to use conditional formatting but can't implement both cell reference and condition function.

Please help.

Thank you...

Hi there! I could have sworn I've been to this blog before but after browsing through some of the post I realized it's new to me. Nonetheless, I'm definitely delighted I found it and I'll be book-marking and checking back often!

Hi, I want to conditional formating rows based off of what is in two different columns

Column1 Column2

1 NG

2 NG

1 OK

3 NG

2 NG

4 OK

I have it set up right now that if its OK it hightlights the row gray and if NG it shows orange. I want to make it that if another entry is entered and it is OK but the first time it is NG it will change the row to gray. So for the example the first row 1 is orange because of NG but when you add in the second 1 with OK it will change the first row 1 to gray also.

Thanks for the help!!

Thank you for this very detailed tutorial!

I was just wondering if it is possible to format a cell (or a whole row in a table ideally) based on an other cell's color? For instance I have a budget sheet with two tables. In my table where I add expenses, I created a Macro to add a new row, and pick a random color for that row. In that row, I have a cell indicating the day of the month that expense is due. I would like it if in my other table, the cell (or row) that corresponds to that date can automatically use the same background color.

I hope I am not being too confusing haha. If so, I would just like to know if I could say: If this cell is that color, then this cell is also that color.

Thanks!

I'm hoping to get some help with a conditional formatting problem I'm having.

I have two columns

-First is a forecasting due date.

Two

I have a conditional formatting challenge I'm hoping to get some direction on.

I have two columns.

-First column is forecasting a "due" date (this date is auto filled based on a previous start date)

-Second column is requesting the "actual" date

I'd like to conditionally format the second "actual" column/cell to go red in the event that it is blank and that the current date is equal to or passed the "due" column date. Once there is a date in the "actual" column and is no longer blank no color will apply.

Thanks for your help.

I was just wondering if it is possible to format a cell (or a whole row in a table ideally) based on an other cell's color? For instance I have a budget sheet with two tables. In my table where I add expenses, I created a Macro to add a new row, and pick a random color for that row. In that row, I have a cell indicating the day of the month that expense is due. I would like it if in my other table, the cell (or row) that corresponds to that date can automatically use the same background color excel formulas: https://www.youtube.com/watch?v=ayVH-Y9-0M4.

I hope I am not being too confusing haha. If so, I would just like to know if I could say: If this cell is that color, then this cell is also that color.

I wander if it is possible to conditionaly format the cells in a table where in a top row is writen which cell in a coresponding column (below) will be highlighted (the values in that column are not in direct relation with values in a heading row.

Here is fragment of such table, where i want highlight 1st, 8th and 9th value (which coresponds to the first column (bins) - althogh that column is redundant)

1 8 9

bins A B C

1 70 0 0

2 53 16 0

3 36 20 1

4 32 20 6

5 28 24 7

6 25 27 10

7 16 26 18

8 17 25 21

9 9 25 14

10 7 16 20

thanks a lot for your help.

I have been exploring for a little for any high quality articles or blog posts on this kind of space . Exploring in Yahoo I at last stumbled upon this web site. Studying this information So i'm happy to convey that I've a very good uncanny feeling I came upon just what I needed. I such a lot for sure will make sure to don?t fail to remember this website and provides it a glance regularly.

If some one wants expert view concerning blogging and site-building then i suggest him/her to go to see this blog, Keep up the good work.

Hello,

I am trying to use the conditional formatting tool. I have 2 columns quantity ordered, quantity shipped, and the percent difference. I would like the percent difference to be colored red if it is +/-10% and yellow if it is +/-5%. Can you please help?

I'm trying to apply a conditional format to a cell based on the value of another cell. Here's what I'm trying to do:

if the value in Cell G10 is 0 (based on this formula (f11-g9), then cellH11 will be green. HOWEVER, because cell G10 contains a formula, I can't make it work. If G10 is hardcoded with "0", then it will work. Any ideas?

Thank you, this tutorial was very helpful to me!

A B C D E F

start end est. work time|work days|days complete|days remaining

2/4/2015 3/18/2015 30 30 10 15

3/5/2015 3/19/2015 10 10 16

2/23/2015 4/3/2015 29 29 27

I NEED COLUMN F TO AUTOMATICALLY CHANGE TO RED OR GREEN. I NEED IT BASED OF COLUMN C.

if F is more than C then I need it to turn green, and if F is less then C I need it turned red......

Please help

I have the same issue. I noticed all her examples are based on ROWS but i need columns.... I need my Column L to be wither RED OR GREEN according to cell Q1 which is a formula for TODAY "=TODAY()" I tried everything it seems to only apply ONE rule but it does not want to apply multiple. have you figured this out?

Hi,

Good day!

Need help here please. I have data that needs conditional formatting as follows:

If Person 1 achieves 1 to 5 points it will show result "POOR"

But if the Person 1 achieves 6 to 10 points it will show result "GOOD"

But if the Person 1 achieves 11 to 15 points it will show result "VERY GOOD"

But if the Person 1 achieves 16 to 20 points it will show result "EXCELLENT"

Can anyone help me to have the right formula for this? Thanks in Advance guys!

Helpful information. Lucky me I discovered your website accidentally, and I'm stunned why this twist of fate did not came about earlier! I bookmarked it.

Pretty great post. I simply stumbled upon your weblog and wished to say that I have really enjoyed browsing your blog posts. In any case I'll be subscribing for your rss feed and I hope you write once more soon!

any formula which help me if i change value of 1st column and then change in amount in other column .....

Hi Svetlana, I have created rules that are now working just fine in a table I created (Rules 1-4 below). However, I want to create another formula that will override the first formatting when create a new rule (#5) so that the row turns purple when a new value is the designated column is entered.

Rules:

1) When YES=1.0, row from colA to colK turns GREEN

2) When NO=1.0, row from colA to colK turns RED

3) When ABSTAIN=1.0, row from colA to colK turns LIGHT ORANGE

4) When ABSENT=1.0, row from colA to colK turns LIGHT GRAY

5) When NP=X, row from colA to colK turns PURPLE

Please help!

I am almost positive this cannot be done with Conditional Formatting, but I figured I would ask anyways.

Is it possible to Temporarily for a selection of Cells on Sheet2 based on Cell selection on Sheet1? Example: If Cell A1 is selected on Sheet1, I want Cells $A$1:$B$10 to be filled with Yellow, Bold, Italic, and Size 14 Font.

Thanks in advance.

I am using Excel 2013

When I copy values to cells that already have conditional formatting I find that sometimes the CONDITIONAL formatting is duplicated.

Is there a way of copy / paste that stops CONDITIONAL duplications??

Is there a way to remove CONDITIONAL format duplications

Your help would be appreciated!!

My requirement is ,

I am trying to create check list . In column level I have all the days from JAN to dec. In row level I have assets to check. I need to highlight cells whcih will be 30 days next to the last updated cell.

eg : I have ABC asset check on 1 st of JAN and the cell coresponds to 30 of JAn should be highlighted , which shows service is pending for that asset.

Hello,

Your blog is very informational. Excel is fascinating. Thank you for posting.

Is there any way to link cells with conditional formatting without Excel displaying the 0.00 and coloring the cells red? Excel 2010

I have a spreadsheet where I have different tabs for each locations and then the last tab is all locations combined. I entered data in the locations combined tab and used the following conditional formatting to mark everything smaller that 0.85 red, but no coloring for the empty cells: AND(D1"",D1<0.85)

It works perfect. HOWEVER, when I link these cells to the ones in the other tabs, all conditionally formatted cells turn red, and show the value 0.00. When I check the formula used for conditional formatting it is the same as the above with the cell name corresponding to the new one.

Thank you in advance for your help.

Hi Svetlana,

Very helpful! In your Formulas to compare values (numbers and text), I didn't see anything to indicate "between." I need conditional formatting in Col C to reference numbers in Col D. Cells in Col C should be light red if the numbers in Col D are between 51-79. How would I write that in a formula? =D1>=51...<=79

Think I got it:

=AND(D1>=51,D1<=79)

Hi Fylum,

Oops, that way my omission. You are right, the AND function works for Between rules, just added it to the corresponding section in the post, thanks!

Hi,

can you help please?

In an excel sheet like this and I want to highlight the highest value in each group, what formula should I use?

Value Group

819.23 1

814.08 1

808.47 1

809.33 1

805.7 1

799.23 2

796.79 2

796.73 2

791.25 2

791.97 2

784.52 3

783.13 3

788.61 3

793.16 3

789.4 3

777.52 4

773.03 4

769.87 4

760.69 4

756.2 4

Thank you so much!

Maggie

Hi Svetlana,

I am trying to implement conditional formatting wherein if a cell contains any of the special characters it should be highlighted..i'm using the "text that contains" option for it..its working fine for every character except *..when i use it..it selects the entire column..any suggestions ?..another thing i wanted to ask was is it possible to do this entire thing through a formula using OR operator rather than setting a condition for each and every special character ??

Thanks,

Nemish

hi,

my data contains lots of row & columns containing Numerical value data like:-

A, B, C, D

90, 80, 50, 40

65, 45, 54, 55

54, 85, 45, 26

what i want is highlight the lowest value in each row in one attempt.

I can highlight the lowest value in each row by applying Conditional formatting formula

=A1=MIN($A1:$D1).by this formula i can highlight each row one by one but i need a formula by which i can highlight all the lowest values in each row in one attempt please help me on this its urgent

Hello Svetlana,

I do not know if this has been asked.

In my spreadsheet I want to highlight rows based on the content of colomn H which contains the open (red) or closed (green) condition.

-Denise

Greetings! I read the areticle and most of the questions and responses above and still haven't a clue how to manage this conditional formatting issue.

Working with dates makes it a little more complex, yet I think this can be done:

For a row of data, compare the date in column F to the date in column C and the date in column E. Highlight cell in column F if either or both dates in C and E are later than the date in column F. In other words, the dates in C and E must have occurred before the date in column F.

Example:

C = 3/8/15; E = 3/8/15; F = 3/9/15 == no highlight

C = 3/9/15; E = 3/4/15; F = 3/8/15 == HIGHLIGHT

C = 3/15/15; E = 3/15/15; F = 3/15/15 == no highlight

C = 3/19/15; E = 3/20/15; F = 3/18/15 == HIGHLIGHT

Please help!

Hi, I have spreadsheet with several columns and currently 151 rows. New rows are added regularly. After new row is added, I want to highlight lowest eight (8) values from the last 20 rows in one particular column. So right now, I want to highlight 8 lowest values in range (L132:L151). I know how to use array formula to find those 8 lowest values, but cannot figure out how to highlight them...

Hi, my data starts in cell A23. I will be adding numbers to column A, that will range from 1 to 300 or sometimes more. Once all of the numbers are entered, I highlight my work sheet starting with Row 23 and Sort by Smallest to Largest. I'm trying to do conditional Formatting (Excel 2007) so that I can immediately spot if I have omitted a number in the sequence. The formula I'm using in A23 is:

$A24-1

Then I choose a color to format the cell if said condition is true.

It shows up in the Conditional Formatting editing bar as the following and is not working:

="$A24-1"

I also have a second condition in Column A for Duplicate Values which is working fine:

=$A$23:$A$526

Could the two be different conditions be the problem?

Thanks!!

Thanks For the tutorial..

Here is my dilemma:

I have 1 spreadsheet with 2 specific columns containing times in minutes (Column V and W). I want to generate a conditional format that will highlight the entire row if both column V and W are greater than 60 minutes. I was successful if V alone is >60 using the following formula:

=INDIRECT("V"&ROW())>60

I just can't figure out how to get it to do it for both V and W.

I need to compare 2 columns in 2 tabs in excel

Tab 1 & Tab 2

Column D has project#'s

Column L has dates

- both tabs have the same amount of columns, but count of rows will change

Project#'s are not necessarily in order, but if they do match and the dates in column L match, it is ok.

If the date in column L changes, i would like to see it highlighted in column L in Tab 1.

Any help would be appreciated!!

Hi Svetlana,

I am trying to do highlighted conditional formatting for certain cells. When each cell is equal to 9.5%, it will be highlighted green. I pressed selected each cell using ctrl and entered the conditional formatting desired. However, it is working for every cell but one (it is being highlighted red when the cell is equal to 9.5%). I doubled checked in manager and the rule is correct, so I'm not sure why this is happening!

Any help you can provide would be much appreciated.

Thank you!

Hi Nicole,

I would advise to double check 3 most obvious things:

1. The rule applies to the correct range of cells (not including the column headers if any).

2. If you created a rule with a formula, the formula is written for the left-most cell in the rage. For example, if you highlight rows 2 through 10, you should write the formula for row 2, e.g. $A2=9.5%

3. Check the value in that stubborn cell. It may happen that the cell displays just 1 decimal place, while the real value in the cell is, for example, 9.51%. So, select that cell and view the actual value in the formula bar.

I have been using a simple formula (=D3>C3) and its reverse (=D3<C3) to decide whether a cell is coloured red or green. The rule applies to all the cells in the column (=$D$3:$D$45). I have applied this rule to three columns in my spreadsheet, Columns C,D and E. The formula works fine in Columns C and D, but does not produce any formatting in E. In every way that I can assess, there is absolutely no difference in the cells in the E column than in the others. I have checked everything I can and I just cannot figure out why it will not work.

Can you help me?

Hi Rob,

Just use absolute column references (with the $ sign) like this:

=$D3>$C3 and =$D3<$C3

I am trying to create a spreadsheet using multiple numbers as status and I want the entire row to turn the correct color for that status. Example 1 new job want the color to be white, 2 contacted customer want the color to be pink 3 ordered parts want the color to be yellow, etc. to the final 6 green ready to invoice. I will have multiple columns in the row but I want the color to change based on the final column where I update status.

Hi Svetlana, my job is to keep track of approaching oil changes needed. I have the (A)column with the Vehicle #s, the(B)column with the current mileage on the vehicles, and the (C)column with the mileage when the oil change is due. I've been trying to find a formula that I could use to automatically highlight the current mileage cells that are within 500 miles of the mileage when oil change is due (C).

I would greatly appreciate your help.

Thank you!

Hi,

Is there any formula that will define the function of one cell depend upon the result of another cell. If the result of one cell is "Yes" then the formula in another cell will be executed accordingly, otherwise not.

Can you help me?

Thank you

Hi Deepesh,

You can wrap your formula in the IF function to have it executed only when another condition is met. For example:

=IF(A1="yes", formula, "")

A real formula may look similar to this:

=IF(A1="yes", SUM(A2:A4), "")

Thank you So much!!!

Hi,

I'm trying to highlight cells in one column where they differ from the corresponding cell in another column.

So if E2C2, I want it highlighted, similarly if E3C3 etc. I've tried applying a rule to all of column E using the formula "=$E2$C2" (there are headers in row 1), but this produces random results. I've tried changing the fixed portion of the cell reference - E$2, $E$2, etc, but none of them works as expected.

Can I do what I'm trying to do, or am I approaching it the wrong way?

Thanks

Nick

The comments function has swallowed the symbols. Originally this said "if E2 not equals C2" using chevrons, etc.

Hi Nick,

I believe you meant =$E2<>$C2 (formulas often get messed up after posting, sorry for that).

This is a correct formula and I can think of just one reason for it not working - a rule is applied to a wrong range. Please open the Rule Manager and check if it applies to the range beginning with cell E2.

Thanks Svetlana,

Yes, that's exactly what I typed, before it got mangled :)

Originally it applied to the whole column ($E:$E), but I changed it to E2:E1000. This made no difference.

The E column is composed of values obtained by a vlookup() from another sheet. Will this mess things up?

Thanks

Nick

Nick,

In theory, this should make no difference, unless the numbers are formatted as text. Anyway, if you can send me your sample sheet (support@ablebits.com), we will try to figure that thing out. I am curious to know why it does not work on your data :)

Just an afterthought. Did you check the formula after changing the applied range? Excel sometimes changes the references as it thinks is appropriate, so please double check.

I have a list of different items (food menu) to cook, and on monthly basis I want to select from the list. but if I entered a manual item (that is not listed in the list) it should be a different colored text. I cant get result. I don't know how it could be.

Please help

Hi Svetlana,

=MATCH(TRIM($Q2),A:A,0)

why does this return the correct cell number where the match is at, as to this

=MATCH(TRIM($Q2),A2:A350,0) or =MATCH(TRIM($Q4),$A$2:$A$350,0)

when using either of the above it makes the cell value off by 1. i.e. the actual cell where value is at: 3 but returns: 2

thanks so much

great stuff!!

BE

Hello Svetlana,

I am creating a workbook to track and rank various statistics for my office's summer golf league. I am running into a handful of formatting snags.

Some of the stuff that I want to do is a bit more complex than I anticipated but I know it can be done in Excel. My hope is that the workbook can very automated with regards to data input.

Please contact me if you are still available......I see the last post was from almost 1 year ago.

Thank you so much for your time.

Brad Sanok

Oh.....

I must have been looking at the first post :/

Hello!

I'm working on a sheet. In my G Column I have whether the task is "Resolved" Or not.

The two options are either yes, or no.

Columns A-F is the corresponding information for that task. Each row is a different task.

I can get Column G to go green for yes and red for no, but I can't get the corresponding information in rows A-F go green or red for the corresponding Yes/No in Column G. What is the formula I should be using here?

Thank you for your help!!

Julia

Hi Julia,

You use the same formulas as you used to highlight column G but apply the rule to columns A-F, e.g. A2:F100. Given that row 2 is your first row with data, not including the column headers.

Hi Svetlana,

First thanks for clear and more useful data u explained me to learn from this site.

Please clear this my problem if you can.

Problem:

In Jan'08 month I spend $2000 for on marketing and I earned $200 each month till jan'2010.

And I continue spending more every month till 2015.

Now I want to highlight the month where my spend reached break even or my budget.

For example: my spend $2000 reached in Aug'09 month.

Please let me know if you understand my problem.

Thanks & Regards

Satish.V

Hello,

I am hoping you can help me with a question I have in regards to conditional formatting a cell.

I am try to conditional format cell D3 so that it is green if it is more than 50%>B3*20, red if it is <B3*20, and yellow in between.

Is this possible?

Thanks,

Jackie

Hi Jackie,

Here are the green and red formulas as per your conditions:

Green (if D3 is more than 50% greater than B3*20): =D3-(B3*20)/B3*20>50%

Red (if D3 is less than B3*20): =D3<B3*20

And exactly what "in between" means? :)

Thank you so much! :)

There is no in between.

Hi... I have to perform conditional formatting on a particular column, which should display the numbers entered into it, in 3 decimal format.

My Condition is such that, a cell say example : E5, has some product name "ABCD", based on this text, column of say for example 50cells, has to display the data entered into it in decimal format, for example : 5 decimal places....If the product name differs, the decimal format has to change as per the product.. Product is an electronic product, each product provides output in decimal format of different decimal places(5, 4, 3, 2, etc,.).

Dear Svetlana

Looking at all of these posts you certainly do know your stuff!

I need to use duplicate conditional formatting to identify duplicates within a single column, however, I want this to apply to certain cells within the column, so E1-E3, then to start again at E4-E11 etc. I have ~1500 rows of data. The range of cells I want it to perform this on is dependent upon values in another column, which always start at 1 and increase in ones i.e.1,2,3 etc. I want the conditional formatting to start again every time it comes across a 1 for the second time within the other column:

Presentation Chosen box

1 4

2 10

1 4

2 6

3 8

Here, Excel should not highlight the two cells containing '4', as these are within separate ranges (range 1: 1,2; range 2: 1,2,3). I only want it to identify duplicates within the range of cells depending on the values in column 'presentation'.

I am not sure if this can be done. I have searched for a few hours and read various posts but it is looking bleak.

Many thanks in advance, Claire

Hi Svetlana,

I have a table with some name positions and values for them in 3 currencyes ($, Euro, GPB)

Have already made a function that whenever I select one of the currency to bring the value just for the respective currency that I have selected. The problem is that it will bring just the value.

Is there any format function that when I select the currency type to format the cell in (either $, E, or GPB - what I selected), so that it will not birng only the value that I need, but to be formated and contain the currency?

Many thanks

Hi Vladimir,

It's difficult to advise anything without seeing your formula. In most cases, you can use the concatenation operator, like this:

=IF(A1="$", B1&"$", "")

or

=IF(A1="$", B1&A1, "")

I have a question.

I have this formula.

(ROUND(MROUND((RAND()*(99-75)+75), (100/34)),0) which correctly returns a random value between 75 and 100. However, I want it to return a value that does not equal 100. I am a bit stuck on this one. So for example, it will return a whole number but it will round the value up to 100 on some trials. That is not good. How can I reconfigure this forumla to react properly? Thanks.

I forgot to mention that the number 34 is the raw value I am using as a divisor. This value can change. For example it can be a 12 or 15 or whatever number.

HI,

I just need to get an formula if week cover is higher than 3 how I can block the cell in CTN,so that others cant input anything in that cell.

Dept Article UPC Description Pac WHS CTN IN CTN IN SINGLES STR STK Incl Tst Avg Sale Week Cover

F02 20001578 62886 CRINKLE CUT CHIPS 12 600 50.00 0 31 31 4.15 7.46

F02 20002307 343121 CHUNKY COD FISH FINGERS 12 2076 173.00 0 28 28 5.76 4.87

F02 20002345 323796 STRAIGHT CUT CHIPS 12 1128 94.00 0 8 8 3.03 2.64

kindly covert all this in excel and let me know the fromula

Hi, I have a question.

I have an excel spreadsheet that I am trying to compare pricing on.

So I have all the information of the vendor, product description, etc. In column L I have the price that the vendor charged us for that product. Each product description has a different contract price. However, the vendor does not always charge us the correct contract price. Is there anyway to apply this type of conditional formatting to a spreadsheet like this? Below is close to what my columns show.

Invoice # Number/SUPC Item Desc Purchase(cs) Vendor Price

5011210 157048861 PIE 2 cases $49.38

So the vendor charged us $49.38 per case, but we should have only been charged $49.11 per case.

Does this make sense as to what I am asking? I am having to go through this manually over 10,000 line items. Every lime item could be different though. I know excel has the tools and technique to help me with this, I am just not sure what formula to use.

Any help or suggestions would be greatly appreciated!

Hi, I am referencing cells in a data entry worksheet to create coordinating filled cells in a separate sheet. However, when I use Format Painter to copy the conditional formats I created into 6 additional cells, and then edit the cell references to the coordinating cells in the data entry sheet, it changes all the cell references in all the "painted" formats. Is there a way to turn this off, or do I just have to write each conditional format independently?

Thanks for your help!

I have a Excel sheet where attendance of various students are marked.Now I would like to highlight the cells in which "present" occurs more than 7 times consecutively (i.e a student is present continuously for 7 days excluding sundays) for each student...?

hi

i want to highlight values in a column based on the following condition:-

column to highlight is AC which has % figures in few rows.

CONDITION -if the dates in the cells range(J8:O8>8TH MAY'15)THEN HIGHLIGHT THE %VALUES IN COLUMN AC. rows

kindly suggest solution.

Hi

I have a rule

=IF(OR(DH1=8471702000,DH1=8471609000,DH1=9013901000,DH1=9031499090, DH1=8544422900,DH1=8541409000,DH1=8205400000,DH1=8504401990, DH1=8471703090,DH1=8443321200,DH1=9030311000),AND(BR1="CN", DD1="EXCH NEW"))

If it find these numbers in DH column and same for BR and DD column than it will color a column green,

Now i want to change the rule like color my required column if BR is "CN" and DD is "EXCH NEW" but only where there these no. are not coming in Column DH,

Means same formula just to ignore these no.

I tried in place of = but it does not work. It work if we right as a formula in cell but if i tried to add as a new rule in conditional formatting for color than it does not work.

Can you provide me any help or suggestion on this.

I'm using the "between" rule to color code some thickness data, but it is not being inclusive like it should. If the value is exactly the value of one of the bounds, then the cell stays white. I can fix it by having the values range to the value I want plus 0.001, but this is annoying and will take awhile to fix for all twenty tabs of data. Any ideas?

Thanks!

Hello-- Using Excel 2007---2 questions--

1st --I have a column of cells (column B) containing text and two digit numbers in the same cell. I want the column next to it (column A) to have a conditional format based on whether that 2nd column has a number within a specific range. Meaning if it has a number between 10 and 19 the first column will be green, if between 20 and 29 it will be red, if it has a value between 30 and 40 it is a blue.

2nd--Is it is possible to have is rule skip a number if it is followed by the word "egg" and only read the 2nd number for the conditional formatting rule?

Here are some examples of the text and number in the second column.

3 Split 15 Blast-(Column A Should be Green)

4 Right 16 Blast-(Column A Should be Green)

5 Split 23 Egg 16 Dive-(Column A Should be Green)

6 Split 38 Egg Fly 23 Dive-(Column A Should be Red)

7 Split 22 Dive 37 Egg-(Column A Should be Red)

8 Split 33 Dive 28 Egg-(Column A Should be Blue)

9 Split 33 Egg 28 Around-(Column A Should be Red)

10 Twins R 37 Egg Fly 24 Dive-(Column A Should be Red)

11 Split 23 Egg 30-R Flat-(Column A Should be Blue)

Is this possible

Hello Marty,

Thank you for the detailed description! Yes, it is possible, but you need the UDF function on VBA (to use regular expressions during the search).

I am sorry, we can’t help you with a macro. Please ask for it in specialized sections on http://www.mrexcel or http://www.excelforum.com

I am trying to conditional format formulas that contain an adjustment to the formula. For example We will have A1+A2. I want to identify formulas that have A1+A2+1000 or A1+A2*2 etc. Formulas that have a component of the formula that is not a reference to another cell.

I already can conditional format cells containing formulas ve values. I just can't see formulas that are adjusted and not overwritten completely.

Thank you for the help.

Helllo Chris,

It is an interesting task. You need to add User Defined Function (UDF) to your workbook. Here is the code:

Function GetFormula(rng As range) As String

getFormula = rng.Formula

End Function

For more details how to insert and run VBA code in Excel, please see here:

https://www.ablebits.com/office-addins-blog/2013/12/06/add-run-vba-macro-excel/

Then select all the cells with formulas that you want to check, e.g. from F2 till E20, and create a conditional formatting rule using the formula below:

=NOT(ISERR(FIND(RIGHT(GetFormula($B$3),LEN(GetFormula($B$3))-1),GetFormula(F2),1)))

Where $B$3 is the cell with a sample formula that you want to search, e.g. =A1+A2.

If you know for sure what “text” you are looking for, then replace this part of the formula RIGHT(GetFormula($B$3),LEN(GetFormula($B$3))-1) with the “text” you want to search, e. g.:

=NOT(ISERR(FIND("A1+A2",GetFormula(F2),1)))

I have this table, it show like this:

Given no. USL LSL Measured value Deviation Out of Scope

(GN) + - (MV) (GN - MV) (This I want to get the answer) /

42 42.3 41.7 42.38 .38 .08 (to get this, must choose / which is more nearer, to the

/ Given no. the USL or / LSL

Hello, Chona,

I am sorry, it is not very clear what result you want to get. Please send a small sample workbook with your source data and the expected result to support@ablebits.com.

We’ll look into your task and try to help.

Hi Alexxander , can you please advice me something in comment # 269

Hi Svetlana,

I am trying to fill one cell based on the value of another previously given.

The problem is shwon in the example, number from 01 to 20 will appear in the first 4 columns (C1-C4). I want to take these values and put them into a respective contiguous set of columns (C6-C26). Is it something feasible in excel?

I have this situation:

C01 C02 C03 C04 C05 C06 C07 C08 C09 C10 C11 C12 C13 C14 C15 C16 C17 C18 C19

01 05 09 14 01 05 09 14

02 07 11 12 02 07 11 12

08 09 10 12 08 09 10 12

04 05 13 14 04 05 13 14

and so on

Thanks and Regards,

Ed

Hi,

I received quotation from different supplier and I need to compare the received prices. Can you please advise how to use conditioning function for comparing prices from different supplier. I want to get all best lowest prices in Green and highest price in Red.

Hi,

I have data's in 1st four column on the excel sheet. In those four columns i have common / similar data in column A and C. Column B and D consists of values which has to be reconcilied by matching the datas of A and C. For example

Example 1

Column A = 1

Column C = 1

Column B = 0.002

Column D = 0.002

The column E should show it is matching.

Exapmle 2

Column A = 1

Column C = 1

Column B = 0.02

Column D = 0.002

The column E should show it is not matching.

The main constraint over here is we can have datas in column A is missing in Column C.on those scenario it should show as NA in column E.

Kindly help me at the earliest.

Thanks is advance.

Jeetesh Jain.

Hi All,

Can any one help me on my request?

Thanks in advance

Best Regards

Jeetesh Jain

Hey, guys.

I would like to conditionally format cells which are contained in a formula.

Ex: If A11 equals the Sum of A1:A10, I would like A1 through A10 highlighted a certain color.

This would allow me to quickly see what cells are in the summation without putting the cursor in the formula bar up top.

Thanks.

Hi Ben,

Select cells A1:A10 and create a rule with the following formula:

=$A$11=SUM($A$1:$A$10)

Im doing a data bar formatting for a cell, and I would like the color of the data bar to change relative to the value of another cell.

Hi Luis,

Select the cells where you want data bars to appear, click Conditional formatting > Data bars > More rules. In the "New Formatting Rule" window, select Formula in the "Type" box and enter your formula in the "Value" box. Just keep in mind that relative cell references are not allowed in Data bar formulas.

I'm having a problem with changing a cell colour based on multiple cell values.

Example

Column A has 3 values using a data validation list "requested, booked and delivered"

Column B has the date of request.

I would like the cell in column B to change colour if Column a value is "requested" and if date in column B is over 14 days old.

Any help would be really appreciated

Hi Tom,

Assuming that row 2 is your first row with data, select all the cells in column B you want to color beginning with cell B2 and create a rule with the following formula:

=AND($A2="requested",TODAY()-$B2>14)

Hi Svetlana,

First of all Congratulations for your blog! I find it 'state of the art' and a precious on-line resource. Of course I will spread the word about it...!

As I wasn't able to find a solution that works among the tutorials and examples you posted above, please allow to present my question:

How to apply conditional formatting to columns F, G, H and I (by instance change font colour to 'red'...) when it met a given criteria (comprised of the word string IMP) in the same line in column A (in Microsoft Excel 2007)...? Or in another way, which formula to use...?

I deeply appreciate your help. Thank you.

Kind regards,

Carlos

Hello Carlos,

Thank you very much for your kind words.

You can select the entire columns $F:$I and create a rule with the following formula:

=$A1="IMP"

The above formula works for the exact match. In case you are looking for a partial match formula, i.e. highlight columns F:I if column A contains values like "IMP 2" or "xIMP", then use the SEARCH function as follows:

=SEARCH("IMP", $A1)>0

Hey there,

I'm trying to set a conditional format where I want to change the colour of column A if the column width does not equal "10.29".

Would you be able to help out?

Thanks,

Jon

Hey Jon,

I have been trying to attempt the same thing with cell formulas. I have put in =cell("WIDTH") but it does not show the exact amount. Let me know if you have any luck with finding a formula.

Matt

Hi,

I have been trying to do cell formatting for following condition:

=$Q3$AS3

I want to highlight the cells of column Q3 if the value doesn't match with values in column AS.

I used above mentioned condition but somehow it's highlighting all the rows and columns from Q until AS. I tried to select following ranges "Q3:Q100" as well as "Q3:AS3, Q100:AS100", but no use.

Please suggest.

Thanks,

Shipra

Hi Shipra,

I have just created a rule for Q3:Q100 with the following formula and it highlighted only cells in column Q that are not equal to values in column AS in the same row:

=$Q3<>$AS3

Please double check the applied range via Conditional Formatting > Manage Rules.

Hi there,

I got set of data and I need to color the cell based on value row before it.

Ex.

A B C D

a 2 1 3 4

b 3 0 4 5

c 1 3 5 7

d 8 9 3 3

I need to color the Ab red (>Aa) and Bb green (<Ba). I want to apply the rules to all row and column. Is there anyway i can do it?

Hi,

Great forum, hopefully what i'm trying to do is possible. Is it possible to inherit the color from referenced cells. For example, if I had a formula: =concatenate("This is a test ",B2). I need to inherit the existing value and color in cell B2.

Hi,

i am working on shift roster excel and i want to highlight only shift person name cell who is today.

e.g.

row A1 has Date

column A2 has shift person name

and B2-z2 has shift name(Day,Night)

formula has to first check today's date then search in that column the shift name(day,night) if match Day the highlight the shift person name which is in column A2.

I want to count payments: 1 of 30, 2 of 30 by writing 1/30, 2/30 and so on. I want to write two cells and drag to create the rest (as I do with dates or numgers).

Can you suggest a way to do this? Thank you in advance

Hi

If anyone can suggest a reason for the following problem i'd be grateful.

I am using conditional formatting to colour code times and distances for track and field according to a set of standards.

For example I have formatted columns A, B, C, D so that

2.5 to 3 are red

3.1 to 4.49 are yellow

4.5 and greater are green.

I want to format other columns to use the same colour system but for different parameters as they are to represent different events.

I have tried copy and paste as well as format painter to save time and then edit the rules only, removing the need to select the formatting each time.

However, when I highlight a selection and edit the rule (checking that current selection is correct) it applies the rule change to the entire sheet!!

Why does this happen?

Yours

Matt

Does anyone know how to make a conditional format to create a specific number based on another cells number?

Example:

Cell 1 shows the number 3

I need cell 2 to then show the number 1.

All in increments of 3, if it shows 6 then it will show 2.

9 = 3

12 = 4 etc. Also, If it is between 3 and 5 it will still show a 1, between 6 and 8 it will still show a 2 and so on.

Any help would on this conditional formatting would be appreciated.

Hi Shawn,

I believe a Lookup Formula would be your best option.

If you have your data starting in cell A2, you can add the following formula in cell B2:

=LOOKUP(lookup_value, lookup_vector, [result_vector])

=LOOKUP(A2,{3,6,9,12},{"1","2","3","4"})

You can keep expanding the formula by increments of 3, but make sure you update the lookup_vector and result_vector.

I hope this helps.

So I have this data on a summary sheet:

#INT1 #INT1 #INT2 #INT2 #INT3 #INT3

$DAT Y $FILB Y $DAT Y

$FIL-B Y $FIL-H Y $FIL-B Y

$FIL-H Y $FIL-POS Y $FIL-H Y

$FIL-POS Y $N/A-FIL YYYYYYNN $FIL-POS Y

$N/A-FIL YYYYYYNN $SEC-M NNNYYNNN $N/A-FIL YYYYYYNN

$ORD-FIL YYYYNNNN BACF NNNYNNNN $ORD-FIL NNNYNNNN

$SEC-M NNNYYNNN BARS YYNYNNNN $SEC-M NNNYYNNN

$SEC-USR NNNYNNNN BATS NNNYNNNN $STATS Y

$STATS Y BBDS YNNYNNNN AONE NNNYNNNN

AONE YYNYNNNN BBIF NNNYNNNN AORD YYYYNNNN

AORD YYYYNNNN BCAT NNNYNNNN ASEC NNNYNNNN

And so on…

I was wondering if there was a way I could check row A and B against all other rows for pairs of data like $DAT and Y would be what to check for so $DAT and Y would be highlighted in A,B and E, F and the whole sheet.

Any help would be greatly appreciated. Thank you. I can send a sample spreadsheet if you need.

Hi guys, can someone help me please..

How To use conditional formatting for example... in cell A1 Sheet 1, based on the value from cell A2 in Sheet 2.

So...

If Cell A2 (Sheet2) = "DA"....then Cell A1 (Sheet1) background is RED.

Thank You

Hi Ivan,

Create a rule for cell A1 Sheet 1 with the following formula:

=Sheet2!$A2="DA"

I have several series of data validation dropdowns, and lets say when E5 = text_value i want G5 to be highlighted

because under specific conditions (depending on what previous choices are made) there needs to be an additional dropdown. i am not concerned with making a conditional data validation (probably not possible anyway) but i was hoping someone could help so that i could just highlight it so it sticks out when additional information is required

nevermind!! i got it! after reading other situations i realized that the rule would be specific to the selected cell and wouldnt necessarily be a general formula for the entire sheet

Hi Svetlana!

I'm copying exact version of your formula: =AND($B2>5, $B20 but when using "AND" function and trying to make multiple criterias it just keep giving error.

Wbr

Hi Suva,

Please post the entire formula you are using and we will try to figure out the root of the problem.

Hi Svetlana.

I have a conditional format running that changes a cell blue if the letters GI are entered or red if the letters AFM are entered, I also need the cell to the left of GI or AFM cell to format blue or red. I have tried many formulas but without any luck

Hi Garry,

Just apply the same rules to two columns instead of one.

Is there a way to conditionally format cells to match the fill color of an original cell with matching text that was manually color filled?

Hi svetlana,

Is there a way to colour a cell with two colours depending on a values cells in other work sheet?

ex: sheet 1 cell A1 to be colored with red, if value in sheet 2 cell A1>0 and also sheet 1 cell A1 to be colored with green, if value in sheet 2 cell B1>0

Hi Thushan,

Of course, it's possible. In conditional formatting formulas you can refer to other sheets just as you would normally do. For example, you can create 2 different rules for A1 in sheet 1:

Red: =Sheet2!$A1>0

Green: =Sheet2!$B1>0

I have the traffic light icon working in the cell that has the value, however I want the value to be in one cell the the traffic light to be in the next cell. Is that possible?

Hello Caren,

Because it is not possible to use relative references in conditional formatting criteria for icon sets, you cannot apply icons based on another cell's value.

As a workaround, you can copy the values to the next column, say by entering a simple formula like =$A1 in cell B1 and then copying it down to other cells in column B. Then you apply icons to column B and select the "Show Icon Only" option. So, visually you will have values in column A and corresponding icons will display in column B.

Hello,

i have a small dilemma and would appreciate if anyone could help out.

So i have the following arrangement

J M K S

3 2 3 5 k ?

76 5 75 7 k ?

4 564 76 53 j ?

354 34 456 24 s ?

Were I would like the letters column to be matched to the letters row, and the question marks replaced by the corresponding value under the letters row.

resulting for example in the following

k 3

k 76

j 4

s 24

does anyone know what equation I need to use to substitute the values instead of the question marks?

Thank you

J M K S

3 2 3 5---------k--?

76 5 75 7---------k--?

4 564 76 53--------j--?

354 34 456 24--------s--?

Hi

I wondered if you could help me please. I am trying to create a month by month summary of our customer service scores. All i would like to do is to highlight the cell green or red based on whether the score has increased or decreased from the previous month. For exmaple:

Month Overall

Oct-14 -100

Nov-14 18

Dec-14 -50

Jan-15 -8

Feb-15 45

Mar-15 -2

Apr-15 30

May-15 20

So i would like May's score to be highlighted red because it decreased from April. But April to be highlighted green because it increased from march.

Thanks

Hello! Thanks for the info above.

Please can you help... I am looking for cell A to look at cell B and for cell A to change colour if the value is...

Green - less than 10 of the value of B

Amber - less than 5 of the value of B

Red - equal to or greater than the value of B.

The problem being that both B and A will change with data input and B. Hope that makes sense! Thanks in advance for your help.

I needed conditional formatting for an excel sheet with growth chart. In this i wanna know which have growth and which have de-growth based on last year sales

Thank you so much :)

I've been working on a sales target spreadsheet that has normal formulas & then also using conditional formatting.

In one part of the spreadsheet we are calculating the variance between 2 cells, ie E14-F14 this formula is in cell G14 (figures are 4-4=0). My conditional formatting for all the cells is

=AND(COUNT(B6),B6>=0) set so if the variance is positive the cell will be green

=AND(COUNT(B6),B6<0) set so if the variance is negative the cell will be red

now this conditional formatting making cell G14 red, when we want it to be green. This happening for the cells in column G that have the same formula.

However in all the other columns D, J, M etc if the cell is 1-1=0 the cell will be colored green.

I have removed all the conditional formatting from the excel and inputted again & this hasn't fixed it. I'm not sure what to do next to try & fix this.

I hope this all makes sense & look forward to a response!

Great article but can't find exactly what I'm looking for.

I want to make a formula that will look at a whole column, say the B column, in one sheet and see if there are any "No" entries. If there are ANY "No" entries, I want it to change the colour of a cell, say the A1 cell, in another sheet.

I have a crude formula here, using a "TRUE" statement instead of colouring the cell and also giving the range 1-9999 which is ugly: =ISNUMBER(SEARCH("No",Sheet2!B1:B9999))=TRUE

I hope this makes sense and would be really grateful of any response!

Hi Johnny,

I think you can create a rule with a formula similar to this:

=COUNTIF(Sheet2!B:B, "no")>0

Aha! Perfect! Thank you ever so much

Hi,

I want to highlight cell which has specified value. Like if there are 1 to 10 nos. i want to highlight only 3, 2, 7. which formula do i use. Please help

hi,

I want to put a statement in excel and want to add a specific value reference in between the statement as "today total sale is .........( reference of cell B15) and purchase is ....( REference of cell C51). is it possible if yes how????

Hi Kawal,

You don't need the conditional formatting for this task. You can use the CONCATENATE function or the & operator as follows:

="today total sale is "&B15

=CONCATENATE("purchase is ", C51)

Hello Svetlana,

I have 2 columns, first (G) with the Status, validated list, Red, Amber, Green, Closed. On the second column (H), I have % of completion. On H I need to used Data Bars, but the colour needs to be the one described in G column. For Closed will be blue. Can you help me do it?

Thank you,

Marius

Hi Svetlana, Firstly well done on an excellent page and very helpful explanations. I recently came across an auditing spreadsheet where you had questions to answer and the option to select a colour/text from a drop down menu on each scoring cell, in this case Blue, Green Yellow and Red. The spreadsheet then added the number of e.g. RED cells and produced a score. I have not been able to determine how they did this because the spreadsheet was protected. If I have asked the question clearly enough, can you guide me please?

Hi Laurie,

Thanks so much for your kind words.Most likely the colored cells are counted with a macro, may be something like this one. Anyways, it's difficult to say anything with confidence without seeing the source data.

Thank you for a fantastic resource, I'm an inexperienced Excel user but your tutorials have really developed my skills. However, I'm struggling with conditional formatting.

I have a worksheet which calculates gross margins. I'd like to be able to highlight rows where the margin falls below a set level. However the cells that hold the margin contain a formula (=IF(F2=0, "", F2-M2/F2) rather than a value. It is the result of this formula that is the margin.

Please could you advise how I can make the formatting conditional on the result of the formula?

Hi Helen,

I'm glad to know our tutorials have proved helpful. In conditional formatting, it does not really matter if a cell contains a value typed manually or returned by some formula. So, you can create a rule based on a simple formula similar to this:

=$C2<10

Where C2 is the cell with your margin formula and 10 is a "set level".

Hi, thanks for the speedy reply. I wondered if that was the case but I've not had any success.

If I set it to =$N2<50 it highlights every row except those that are blank regardless of the value returned. This is why I thought that maybe it was different for formulas.

Helen,

It's very strange because the rule worked perfectly on my test sheet. Please make sure it applies to a range beginning in row 2, for example A2:N100.

If the problem persists, you can send a sample workbook to our support team (support@ablebits.com) and we will try to figure it out.

Helen,

I'm posting the formula here just in case my message does not reach you for some reason. Because the Gross Profit column displays percentages, the conditional rule formula should be written for percentage as well. Once you change it to =$N2<50%, the rule will work perfectly.

Thanks a lot to you and Google aswell

Dear Svetlana,

first of all let me congratulate you for this excellent blog.

And now to my question:

My worksheet is composed of 26 columns and 81 rows.

Column A contains a list of items and column B their price; column Y the total number of items in stock and column Z the number of items to be put on sale.

Row 1 is a heading.

Cells C2:V2 contain numbers 1 to 20. Cells C3:V81 are empty and should be conditionally formatted, based on the following criteria:

if the number above each cell (C2:V2) is less or equal to the corresponding value of cell Z of the cell's row then that cell must receive a border. Of course, the formatting should change when the value in column Z changes.

I have already tried different methods that seem to work, at least partially (e.g. a formula such as =C$2<=$Z3). The problem is that when te values in Z decrease the borders don't disappear; instead the (now) empty cells keep a double-line vertical border. What am I doing wrong? Is it possible to end with a "clean" sheet without going for a macro?

I hope you can answer me and in the meantime I thank you very much.

Enzo

This site is great! I read through many of the comments and couldn't find anything like this, but it may have already been discussed. I have a column with cities and an adjacent column with states. There are different cities with the same name in several states- Springfield, for example. I want to highlight Springfield, MO in one color and Springfield, IL a different color. Can I create a conditional format that will say: when Cell Q="Springfield" and Cell R="MO", Cell Q should be green. Then if Cell Q = "Springfield" and Cell R= "IL", Cell Q should be blue. Thank you for your assistance!

Hi Helen,

Of course, you can create such a rule, e.g.

Green: =AND($Q2="Springfield", $R2="MO")

You can even list several cities in the first condition so that you won't have to create a separate rule for each city, e.g.

Green: =AND(OR($Q2="Springfield", $Q2="city2", $Q2="city3"), $R2="MO")

This is pretty close to the formula I was already using and I couldn't figure out why it wasn't working! I played around with it a little and after I changed from $Q2 and $R2 to $Q1 and $R1, it worked! Thank you for your help.

Hi There:

I'm working on this project that I use the conditional formatting to change the color of the cell that is doing the calculations. Unfortunately they have changed the requirements and they want me to add another cell that will change its color when the other two cells change there's. for instance if Column A turns red and column B turn green then column C has to turn red. If A and B are both green then C will turn green(if one of the A or B is red then C will always be Red). When the column C turns red it has to display Fail and when Column C is green it has to display Pass. Can we make this in excel? Any feedback will be deeply appreciated.

Hi Svetlana.

I managed to SOLVE my problem.

The trick was to format the cells with a partial border, i.e. leaving the left side blank. Now everything is fine and working.

I wish you all the best.

Enzo

Having a prob with conditional format. I tried using the following formula:

=((M15-K15)/K15)>10%

If it is true then turn the cell to yellow.

#1 It is not turning that cell to yellow.

#2 If I copy the conditional formula to a cell on the SS to verify it shows as true so it is valid.

#3 After I get the correct formula how is it applied to a column because right now it always wants to reference the same line.

=((M15-K15)/K15)>10%

Thanks!

Hi. I am struggling with trying to resolve the icon sets when the data is Zero. I string 7 months of data to compare month to month. I am using the reverse icon when we have a drop in a bad measure. Normally, there is a numerator and denominator. However, on the months where we have consecutive Zero numerators, the icons do not show and only show "0" which I cannot resolve to just be a neutral (no change/yellow arrow). Any suggestions?

Using conditional formatting to highlight calender dates.

Currently if I receive a document on the 1st July, I have to contractually respond within 10 working days. I am using an Icon set to say Green when plenty of time changing to red 3 days before I have to reply.

My problem is once I reply (the date is recorded in another column) I want the Traffic lights to disappear complete. HOW can I do this????

Hello-

I have read through all of the questions on this page and didn’t see this specific question asked. I would greatly appreciate your assistance!

I have an excel worksheet- starting in column and row D6 (start date), E6 (End date), and F6 (Frequency). Across the rows at the top we have weeks starting in column and row G4, H4, I4, etc = (July 13, July 20, July 27), etc.

My first conditional format- to color in the weeks where a communication was sent, worked. That formula was: =AND(G$4$D6) and it applied to: =$G$6:$AM$38

This worked well for the rows with the frequency of daily or weekly. Where we are struggling with is conditionally formatting rows to fill cells with monthly repetition.

Currently, the formula I have: =AND(G$4$D7) is for a specific row i.e. applies to: =$G$7:$AN$7 and this highlights the specific cell that corresponds to the week of the first date that the communication was sent out.

My first question:

1) How do I create a specific conditional formatting rule using the =AND(G$4$D7) formula that fills in a cell every 30 days or 1 month and also corresponds to the correct week, leaves the remainder of the cells blank for that row, and that also ends when the end date in column E says? Will I have to have 2 separate formulas for each row with a monthly frequency? One for filling in the cells, the other for shading the remainder blank? Also, I should be able to specify in one rule that the formula applies to row 7, 10, 15, 22 for example in the “Applies to” section without having to make a new rule for each row, correct?

2) What is the order in the rules manager that these rules should be placed? Should the original formula for all cells be placed at the top or bottom?

Thank you in advance for the help.

How to use text formula in conditional format

ex:7/25/2015

7/26/2015

7/27/2015

7/28/2015

7/29/2015

7/30/2015

on the above date i want to highlight saturday and sunday by using text(a2,"dddd") with conditional foramt, pls helm me.

Thank in advance

Chandra shekhar

Sorry to bother you, but have been trying to get this to work for ages. I have what will eventually be a large table of data. Column A is a word and B to O are a mix of numbers and words.

I need the following to make the cell in column A to be filled say, green if certain criteria are met, orange if others and red if others.

I can't even get the green section to work. This is what I have so far:

I highlight either A2 or B2 to O2 (it doesn't seem to matter what I highlight, nothing works)then enter this:

=and(D2<20, E2<55, F2<50, G2=Low, h2=Nil, j2<15, k2<20, m2<100, 0270 for red, G2 = high for red etc.

If it's impossible to have the other two colours working in conjunction that's fine, even having the green working will be a great help.

Thanks in advance if you can get to it,

regards Liz

i have a sheet with a matrix of users and whether they have access to a security role (roles are columns, names are rows, values are Yes/No). I want to use conditional formatting to compare this to a matrix of classes and highlight where the user's roles differ from the class they are assigned to. is this possible? i tried using a vlookup formula in a rule, and it didn't seem to work. Any thoughts?

i have a sheet with a matrix of users and whether they have access to a security role (roles are columns, names are rows, values are Yes/No). I want to use conditional formatting to compare this to a matrix of classes and highlight where the user's roles differ from the class they are assigned to. is this possible? i tried using a vlookup formula in a rule, and it didn't seem to work. Any thoughts?

Dear Madam,

I am preparing a attendance sheet but I have some confusion with this sheet because I want if a personnel make holiday at Saturday and Monday to I can acquire 3 absent but I design sheet with A for absent and P for Present to that is why I have to face problem I am continuously thinking and applying but still I am unable to get rid of this hindrance kindly help me out.

many thanks.

Hi !

How can I creat a conditional formating with a formula I have in a cell of another sheet of the same document? or How can I use the same formula that for conditional formating in another part of the document?

Thank you

Mary

Hi Svetlana

I would like to highlight cells in a column where the corresponding cells in an adjacent row return a formula error (#N/A). Can this be done with conditional formatting?

Thank you.

Ruth

Hi Ruth,

You can create a rule with a formula similar to =ISNA($A2) where A2 is first row with data in the column that contains #N/A errors.

hye, I want to ask about how to highlight green for passed and red for failed based on another cell result? mind if you can show me the way? thankyou

Hi Husna,

Simply select the column(s) you want to highlight and create a rule with the formula that references another cells. For example:

Green: =$A2="passed"

Red: =$A2="failed"

Hi

I am having a hard time getting some conditional formatting to work, maybe you can help..??

I have a spreadsheet with columns of data

What I want to do is apply a rule to a column, or various columns, that will highlight the cell of a a manually entered figure orange, and leave the cells that contain a formula unaltered.

thanks in advance

Hello,

I need to conditional format cells based on a changing value.

B20 contains a percentage that changes each day (30%, 35%, 40%, etc).

I want cells G23:G37 to conditional format if they are equal to value in B20, within 5% of B20, above B20, and below B20.

Do I need a separate rule for each set of criteria I have or can I combine into one formula line?

Hi Svetlana

I have a large data set in a single column that I want to apply conditional formatting to.

Data in cells A1 and A2 are duplicates, A3 and A4 are duplicates and so on...

I want to format cells were one member of the duplicate differs from the other by more than 1 or less than -1.

This formula: =OR(SUM(A1-A2)>=1,SUM(A1-A2)<=-1) works. But if i use it in conditional formatting on the entire column it pairs [A1 with A2] then [A2 with A3] and [A3 with A4] and so on... Giving me analysis between cells which are not duplicates.

I want the formula to be applied only to 'every other' row?

Can you help? Thanks in advance.

Hi Svetlana

I have 1 empty colum with fill by any color but when i put anything the color will be disappear, please help me to solve the problem.

I am currently having an issue with a format. I have column G (cells 4-20) that have a name populated. I am querying a rotating list of names that populate in column L (typically go down to row 60 or farther). If even one of the names from column G populate in a single row of column L, I would like that row (using L2 as an example) A2:M2 to be highlighted blue.

This has been truly frustrating. Please tell me if there is a fix.

One revision to the document that I believe would be helpful is to explain the relationship between the "Applies to" range and the row number to use in a formula.

For example, if you had selected $A$2:$E$8 then the first row of the range is 2 and your formula should reference cells in row 2 such as $A2, $C2, etc. If you use a row number other than 2 then your formula will be relative to the row it's running on. For example, using $C1 in a formula will reference the value from column C in the previous row and using $C3 will reference the value from column C in the row below the row for the cell the formula is being evaluated on.

The columns are also relative which is why we always use $C2 and not C2 without the leading $. If you were to use C2 in a formula then the excel will fetch data from a cell that both column and row relative to the cell that it's evaluating the formula on. The relative distance is based on the column and row of the upper-left cell in the applies-to range.

Related to this is if while writing a formula you click on cell C2 then Excel inserts the address in your formula as $C$2. This means Excel will always reference cell C2 regardless of what cell it's evaluating when processing condition formulas.

Once you understand how this works then can take advantage of it by having the formatting of a range of cells controlled by one of:

* A single cell ($C$2).

* Cells in a fixed column relative to the current row ($C2).

* Cells in a fixed row relative to the current column (C$2).

* Cells in columns and rows both relative to the current cell (C2).

I have a date in my one cell and I want to highlight the another cell only if the date in particular month and also I want to count if my color code change from above condition.

please help....

Hi PRATIK,

To highlight one cell if another falls withing a certain month, you can create a rule with the following formula:

=MONTH($A2)=1

Where A2 is the top-most cell in the dates column and 1 is the month (Jan in this example).

How can I create a condition for a spreadsheet in which column A will tell me which cell on that row has a value of $0.00? Not a blank value but the actual value of $0.00.

Hi Nikki,

Select the entire column A and create a rule with the following formula:

=AND($A1=0, $A1<>"")

Hi

I am having a hard time getting some conditional formatting to work, maybe you can help..??

I have a spreadsheet with columns of data

What I want to do is apply a rule to a column that will highlight the cell of a manually entered figure orange, and leave the cells that contain a formula with an unaltered format.

thanks in advance

:-)!

Hi Rick,

To leave the cells with formula blank, create a rule with the ISFORMULA function (no background or fill color is selected for this rule) and make sure it comes first in the list of rules, e.g. =ISFORMULA($A1)

To highlight the numbers entered manually with orange, you can create a rule with the formula like =ISNUMBER($A1)

To highlight

Hi Rick,

To leave the cells with formula blank, create a rule with the ISFORMULA function (no background or fill color is selected for this rule) and make sure it comes first in the list of rules, e.g. =ISFORMULA($A1)

To highlight the numbers entered manually with orange, you can create a rule with the formula like =ISNUMBER($A1)

To highlight all cells with values other than formulas, use the formula like =AND(ISFORMULA($A1)=FALSE, $A1<>"") The non-format rule with the ISFORMULA function is not needed in this case.

The following formula looks correct to me, but only affects the first cell in the range. I'm trying to change the fill color in cells B through M of a given row when cell D of that row contains a particular text string. Using row 23 as an example:

Rule =D23="TEST"

Format (pick a fill color)

Applies to =$B$23:$M$23

When I type TEST into cell D, only cell B changes fill color. I've tried this with and without "Stop If True" and both with and without dollar signs in all combinations. I can change any single cell on the worksheet, but putting in a range only affects the first cell.

Thanks very much for any insight you can provide! :)

Hi,

I want to get greatest value among two cells to be in new cell how do I do that.

Regards,

Ahmed

Hi Ahmed,

You can use a formula similar to this:

=MAX(A1,A2)

Thanks a lot.

Hi Svetlana,

I need to conditional format cells based on a changing value.

B20 contains a percentage that changes each day (30%, 35%, 40%, etc).

I want cells G23:G37 to conditional format if they are equal to value in B20, within 5% of B20, above B20, and below B20.

Do I need a separate rule for each set of criteria I have or can I combine into one formula line?

Hi Dillon,

You will need a separate rule for each criteria because you would want to use different colors, right?

And you can create the rules based on the following formulas:

Equal to value in B20: =$G23=$B$20

Within 5% of B20: =ABS(($G23-$B$20)/$B$20)>5%

Above B20:=$G23>$B$20

Below B20:=$G23<$B$20

Hi

i would like to know if it is possible to format a cell depending from other cell, my case is as follows.

i´m doing a vlookup from severals values but in some cases the values are percentages and other integers, in that cases a need to change the format to % or $ so i need the values keeps there format after the retrieve from the vlookup.

thanks

ok,

i was hopping i would find the answer on the page but i haven't so her goes...

what i want is for example in b7= if(b6>b5)=a3 however if (b6<b5)=a2

i cannot figure out how to do this, it needs to be that if the value of cell b6 is greater than cell b5 i get the result as cell a3 however ig cell b6 is less than cell b5 the result is cell a2. how do i do this? (keeping a running tally on a competition and want cell b7 to prepopulate for the winner on any given day)

Hi Shantal,

You don't need conditional formatting for this. Simply enter the following formula in B7:

=IF(B6>B5, A3, IF(B6<B5, A2, ""))

Please keep in mind that if B6=B5, the formula will return an empty string (blank cell).

Hello,

I have the following formula and it keeps producing following error: "#NAME"

=IF(OR(F6=YES, G6=YES, H6=YES), "At Store","Not at Store")

What am I doing wrong? The same formula works if i replace "YES" with "10 or 20 or 30".

Thank you so much.

Hi Sarah,

All text in a formula should be enclosed in double quote marks. Your formula needs to read as follows:

=IF(OR(F6="YES", G6="YES", H6="YES"), "At Store","Not at Store")

Thank you so much. This is great!!!!

As a follow up here is my major issue. How do I add this formula to an if, iserror, index formula? I keep getting an error.

Working Formula:

=IF(ISERROR(INDEX($B$2:$C$41,SMALL(IF($B$2:$B$41=E3,ROW($B$2:$B$41)),COLUMN($A$2:$A$501)),2)),"",INDEX($B$2:$C$41,SMALL(IF($B$2:$B$41=E3,ROW($B$2:$B$41)),COLUMN($A$2:

Non-Working Formula:

=IF(OR(F3="Yes", G3="Yes", H3="Yes"), "Available", "Not Available", ISERROR(INDEX($B$2:$C$41,SMALL(IF($B$2:$B$41=E3,ROW($B$2:$B$41)),COLUMN($B$2:$B$5000)),2)),"",INDEX($B$2:$C$41,SMALL(IF($B$2:$B$41=E3,ROW($B$2:$B$41)),COLUMN($B$2:$B$5000)),2)))

Am I adding to incorrect location?

Hello,

I have a string of numbers:

4 3 8 9 4 6 6 10 6 15 1

I want to higlight each case:

1. in red(for example, or put an lower red arrow) if the number in the next case is lower than the previous,

2. in green(for example, or an upper green arrow) if the number in the next case is bigger and

3. in orange(or square orange arrow) if the number in the next case is equal with the previous.

Thank you.

Hello,

I am trying to highlight a cell (C9) red if it is between 12 and 100 and if another cell(J9) is blank. also want C9 to turn green if it has the same number range but when J9 has "C/W" in there. I know I need to separate formats, but everything I've tried turns the cell green when the blank is there.

thank you

Hello, can you help me with below argument. what formula can i use for this.

a b c

4138.6 6 Tonner TRUE

3188.6 4 Tonner TRUE

3188.6 6 Tonner FALSE

4138.6 4 Tonner FALSE

the argument is (if b=6 tonner and a is greater than 4100 then its true) or (if b=4 tonner and is greater than 3100 then its true.

That was Awesome, Thank you

Hi,

I want to apply conditional formatting on cells within a worksheet that start with the same letter. For example, I have H1, H2, ....., H20 as values in my worksheet and I would like to apply a rule that every time the value in a cell starts with "H", the cell is filled in a certain color.

Can you help me ?

Thanks,

Marc

what is the formula,only one forwarding cell is highlight with color about the calculation of the total amount when it is highlight

i want that if i minus values from two cell the ans i get if less than 0 it should return the value to 0

Hi,

how to set the formula,

if the sum of certain fields equal to or greater than 1 to show the number 5, and if it is less than 1 to show 0.

Hello, I’m trying to use Conditional Formatting to Highlight the Header Row cells if any cell in that column is not blank. So I used =ISBLANK(G2:G10000), but when I use the format painter to apply this rule to the adjacent header row cells, the G2:G10000 reference doesn’t change. So, each column header is looking back at G2:G10000. How can I build my Formula so that Conditional Formatting will highlight the Header Row if the cells each column meet the conditions, as I paint the formula across the header? -Thanks, Ron M.

Hi,

I have a sheet that I want to format.

Column B,C,D will have numbers entered manually (rows 10-50).

Column E will be the sum of B+C+D

Column L will contain a "Y" sometimes.

Here is what I need to do....

I know how to set it up to highlight the highest single value in B or C or D.

And I know how to set it up to highlight the highest value in Column E.

What I don't know how to do is to NOT include in the conditional formatting, any rows where column L has a "Y".

Any assistance is greatly appreciated.

Thank you!

I'm not sure if you've already answered this; I've gone through the comments twice and none seem to address my particular situation (unless I'm blind... twice over :p ).

I've created the conditional format:

Cell Value $g$2 | (format red fill) | =$H$2

So if the values in H2 and G2 are not the same H2 has a red fill. What I want to do now is do the same for the rest of my cells from H3:G3 on down the column. The only way I've been able to do this so far is to create a rule for each and every cell which gets quite tedious as some of my lists are 50+ items long. Is there a quicker way to just copy that conditional formating where the cells automatically change with each row?

Hi Svetlana,

Thx for the great tutorial regarding conditional formatting.

I am having a specific scenario and struggling to find a solution.

I have a data sheet that is sorted by column C and then F.

In my column D, I have dollar values and I need to match the negative ones against the positive ones (but the column C and F values for both negative and positive number must be same) and highlight.

If you could help me regarding this, it would be great.

Thx

Hi,

When using Conditional Formatting:

In cell U2, I would like to populate a formula in the cell if K2 says "Income"

I've tried different ways and I can't get it to work. Help?!

A

Hello ajensen,

Conditional formatting changes a cell's format, but it cannot change the contents of a cell. Probably, it makes sense to enter the following formula in U2:

=IF(K2="Income",YOURFORMULA,"")