Learn how to quickly change the color of the entire row based on a single cell's value in your Excel worksheets. Tips and formula examples for number and text values. Continue reading
by Svetlana Cheusheva, updated on
Learn how to quickly change the color of the entire row based on a single cell's value in your Excel worksheets. Tips and formula examples for number and text values. Continue reading
Comments page 11. Total comments: 546
I need a formula that will make cell "A3" turn Green when cells "E3 through L3" contain the letter "Y"
and also
"A3" turn Red when cells "E3 through L3" contain the letter "N"
Hi Chris,
You just need to put all these conditions in the AND formula, like this:
=AND($E3="Y", $F3="Y", G3="Y", etc.)
Hi Svetlana Cheusheva,
I wanted to send reminders to the stakeholders while exceeding 3 days from last reminder date. I have used the below formatting but I could not highlight the entire rows and also want to ignore weekends (Saturday and Sunday).
Formula used, E.g.,
=$D$2-TODAY()>=3
Thank you.
Hi Bharath,
First off, please check whether your rule applies to the entire rows you want to highlight (without the column headers).
Assuming that the last reminder date is in column D, you need to change your formula as follows:
=TODAY()-$D2>=3
Please pay attention that $D2 should be a mixed cell reference (absolute column - with $ and relative row - without $).
Finally, create one more rule to exclude Saturday and Sunday (do not choose any fill color), move it to the top of the rules list and check "Stop if true" next to it:
=WEEKDAY(D$2,2)>5
Sir,
My problem is when I put formula in one the background and font color should change accordingly.
For example:
A B C D E F G H I
1 BUY SELL PROFIT
RATE RATE /LOSS
2
3 2500 3000 500 I WANT THIS CELL BACKGROUND GREEN
4
5 6000 5500 -500 I WANT THIS CELL BACKGROUND RED
hi just asking please help how to change the color automatically if i input # 4 it will change in other sheet in the entire row it will change color blue.
for ex. 1 pink
2 yellow
3 green
4 blue
How to change a row color based on a number in a single cell worked great. Except I also have your formula to count cells by color and the colors for the conditional formatted cells shows as "no color" in the cells formatting.
Hi,
There is any data in xls but somewhere we are correcting the numbers so i want to highlight such raws where we are doing the correction.
Can you please help me with this?
Thanks
Hardik
Hi Experts,
I have copy pasted data from some website and pasted the content in a cell , say "HELLOWORLD". HELLO is in blue and WORlD is in black.I need to put a ',' after the blue font. so it looks "HELLO,WORLD"
Can i do it? if yes how ?
Note- for limited number of records i could have done it manually but i have lakhs of records and i cannot do it all alone manually.
I want to automate it with some code.
Please help
Thanks in advance
SSK
Hi,
Can you please help me with my formula?!
=OR($D>=20%, $E=8%, $E>=4,$E=3%, $E>=7)
COLOR GREEN
=OR($D<=20%, $E<=3),OR($D=4,$E<=6),OR($D=7)
COLOR RED
1-3 ranking + ctr >20% = green
1-3 ranking + ctr 8% = green
4-6 ranking + ctr 3% = green
7-10 ranking + ctr <3% = red
Thanks
Chantel
Select your column(s) and create 4 rules using the following formulas:
Green
=AND($D2>=20%,$E2>=1,$E2<=3)
=AND($D2=8%,$E2>=1,$E2<=3)
=AND($D2=3%,$E2>=4,$E2<=6)
Red
=AND($D2<3%,$E2>=7,$E2<=10)
Where D is the CTR column, E is the SERP column.
You’ll find more details about the usage of AND/OR here:
https://www.ablebits.com/office-addins-blog/excel-and-or-xor-not-functions/
Hi there, thank you for your helpful article! I am making a two sheet workbook intended to show my company what customers we can contact to let them know a product that they are looking for is coming in on our next shipment. The first sheet is the customer's information and in column A is the style number of the product they are looking for. The second sheet will be where we copy and paste the style numbers of everything we are expecting in on our next shipment. I need to make each row in sheet 1 highlight if the value in column A matches any value in column A of the second sheet. Note, I will be deleting and reentering all style numbers in column A of the second sheet to always be showing our most current shipment, so I cannot enter a specific value to match in the formula because it will always be changing. Thank you for your help on this!
Please post a small sample workbook with your data on our forums and include the result you expect to get. We will try to help.
Awesome, thank you SO much!!
Hi Svetlana
B10060000005
B10060000005
B10060000006
B10060000006
B10060000007
B10060000007
B10060000008
B10060000008
B10060000009
B10060000009
B10060000023
B10060000023
could you please assist I need to give each row contain the same cell value same color, example entire row contain B10060000005 with green, B10060000008 blue ...etc, thank you
In my excel I have two columns Colum B "Account Type" and Column C "Account name"
Column C has all the account names such as Global travel etc... and Column B which is account type as either Account or Agency mentioned in the cells
What I am looking for is to have a formula which highlights cells in column B and C when it finds the word "Travel", "Tour", "Agency" in column C and word "Account" in column B .
Please note it should only highlight when both these criteria are met
Any one Help me
Q. 2 If we put the value >0 to <2000 in column B then column C should be red. In conditional formating
Value Cell Color
2
4
-10
800
-1691
1500
3500
Need Solve
Q. 2 If we put the value >0 to <2000 in column B then column C should be red. In conditional formating
Value Cell Color
2
4
-10
800
-1691
1500
3500
Need Solve
If I have a worksheet with data across columns A to G, I want to use the formula =MOD(ROW(),2)=0
to alternate row colours BUT I need to be able to insert rows sometimes when the data in Column D needs to be the same colour as row above .....
Thanks in advance
Hi Svetlana,
Could you please help me.
I want to change the value of cell based on this condtion.
if A1 cell is coloured Green and B1 cell has value "Yes"
than B2 automatically gets converted into "Yes".
Thanks in Advance
Hi Svetlana,
Could you please help me.
For example, if A1 have a text then B1 will be filled by color,
if A2 have a text then B2 will be filled by color.
I trying to do the formula, but the result is Even A2 blank, B2 filled by color.
Any idea for the formula.
I have a Question when we find any data in spreadsheet through Ctrl+F than that cell Present in a colour based how to use this query.
Hello,
I am trying to make each row change color if within a date range. For example, I would like a specific color for each month. If I type a January date it will be one color, but a February date would be another. I can't seem to figure out how to write the formula for the date range.
Thanks!
Lets say your dates are in column A. Click in that cell
Go to Conditional Formatting. New rule..
Use a formula to determine which cell to format.
Under formatting values. Type in =A1="January"
Click format and choose your color for that month. Say okay. The window will disappear.
Click again on conditional formatting and go to manage rules. First double click the rule. It should be something like = $A$1="January". Remove the dollar sign before the 1. Leave the 1 before the A. In the applies to change it to =$A$1:$last column letter $ lastrow number
Hello
I'm not sure if posted above, but I have one query.
I am using the conditional formatting formula to highlight a range of cells in a row based on a single cell.
I need to do this for 100+ rows. All the same range, but one row after another.
Instead of creating a new condition for each row and cell, can I copy this and apply to each row?
For example, cells B2 to J2 will highlight when K2 >0.
Can I copy this to apply to B3 to J3 when K3>0 and so on?
I would appreciate any help!
Many thanks :)
Chloe
You can usually do this if you use... when$k2>0... This tells it to always use column K. Continue conditional formula as normal.
Go back to conditional formatting to edit. Under your applies to change it to =$B$2:$J$100. (or whatever your final row is)
I found my error, so used to quotations for references. Just had to follow the directions, substitute my settings, and it worked. Thank you for the tip!
Yeah, I tried the conditional formatting based on an 1000 cell array where I need to highlight rows greater than a value. I even set the range for the values I wanted to check (in a single column, then highlighting the rows that cell is in where my established condition is true).
I've got nothing. I've got a separate count for the cells in that column where my same condition exists, and I know for sure it is correct.
Hi,svetlana
Greeting of the day
I want to formula for automotic bold for example..
we find something in our data, after find it become automatic bold or color in excel sheet ,plz help us
Hello Rajesh,
You can create a rule with the formula like this: =SEARCH("text", $A2)>0
And select "Bold" under the "Font style" on the "Font" tab of the "Format Cells" dialog.
I want a useful formula for colouring if a cell value is less or more than original cell value. example, Invoice value is 5000 in cell D cell colour green/white, if received amount is less than 5000 cell colour to be red.
pls reply.
krr sharma
Select column D and create two rules using the following formulas:
Green Rule: =IF(AND($F2<>"", $D2>=$F2)
Red Rule: =IF(AND($F2<>"", $D2<$F2)
Where F is the column with received amount.
HI,
I tried with this formula, not working, pls clarify formula If I received an amount entire row coloured by green, If received less than amount entire row should be red.
KRR Sharma
Hiii....
i want to get a formula & need your help...
if cell d1=fail, then color of cell a2 is blue..how can i do this?
Hi Nazmul,
Simply select cell A2 and create a conditional formatting rule using this formula:
=D1="fail"
Hi Svetlana,
I have a column of data that I will be adding to each day. It will occasionally be the case that the data I add will be a duplicate value already in the column above. Is there a formula in conditional formatting, that will highlight when this happens. Unfortunately using 'Remove Duplicates' or adding a filter is not sufficient as I just need the value highlighted straight away.
Would be great if you could help out.
best wishes,
George
Hi George,
Sorry for a big delay in response. Please see the following article, looks like this is what you need:
https://www.ablebits.com/office-addins-blog/how-to-highlight-duplicates-excel/
Hello Svetlana,
I tried to used the formula shown above, however when I change the dates in the cell to test the formula it does not make the necessary changes. Also, I want to express that I am using the conditionally formatting in a different column in which the dates are being used.
I have a simple need. I need some text in a cell to be of two colors. in "Ending balance: Actual/Budget", the word "Budget" has to be in a different color. When I alter the color on the spreadsheet the program keeps reverting it to black.
How can I do this?
Thanks,
Doug
Hello Everyone,
I have a report that I am attempting to use a conditional format to highlight a cell when the date which is locate in a different column is prior to 06/17/13. Can anyone assist me in sharing the formula to use.
Hello Toni,
Select the entire column with the dates you want to highlight (not including the column header, if any) and create a conditional formatting rule using this formula:
=$A2<"06/17/13 (where A2 is top cell).
Hi Svetlana,
What if you want to highlight an entire row using a color scale that applies to only one column? That is, in your first example at the top, you have a Qty column, and you could easily select conditional formatting -> color scales, and select the color scale of choice. But if you want to copy that color scale across the other columns, excel thinks you want to update your color scale with the values in those columns. So if you try copying the formatting from column c to column b, it will just turn column b green and column c red (or whatever color scale you've selected). I want to highlight ALL of the rows by the relative order quantities. Is there a non-vba solution for this?
Hi everyone
I have a list of names, ID's, dates and hours and I would like to colour the last hour each day by ID/name. How can I do that?
Thanks a lot!
E.g.
Name ID Date Hour
A 1 5/11 8AM
A 1 5/11 6PM (COLOUR THIS ONE)
A 1 6/11 8AM
A 1 6/11 12PM
A 1 6/11 2PM
A 1 6/11 6PM (COLOUR THIS ONE)
B 2 5/11 9AM
B 2 5/11 1PM
B 2 5/11 2PM
B 2 5/11 7PM (COLOOUR THIS ONE)
B 2 6/11 8AM
B 2 6/11 12PM
B 2 6/11 2PM
B 2 6/11 7PM (COLOUR THIS ONE)
I have a very large organizational budget spreadsheet with multiple columns for each month. So November has Primarily two columns and, let's guestimate, 500 rows. I want to set the second column of each month up to auto code red/green if it's more than the planned amount for that bill (listed in column A).
So picture Column A & B, 500 rows (technically still grouped out somewhat). Column A has ... Budget amt and Column B actual bill amt.
--This would be Col A-- --This would be Column B--
Nov Power Budget Amt Actual Bill
LA Power $2700 $2407.22 (Green)
Chic Power $1800 $2019.85 (Red)
NY $1200 $1407.25 (Red)
NewOrl Pow $1000 $859.36 (Green)
Seattle Pow $3500 $3895.67 (Red)
Miami Power $5000 $5262.98 (Red)
MemphisPowr $2000 $1709.24 (Green)
Denver Pow $4500 $4341.72 (Green)
Currently I create this massive 12 month spread at the beginning of the year and set conditional formatting by the (i.e.) budget limitation listed in Column A to code Column B. However, this changes as certain bills do fluctuate throughout the year (Power, gas, etc.).
I'm wondering if there's an easier way to do it? Such as Functions? And could I choose all of Column B above (while it was still empty of values) and set that whole section to 'format' appropriately as the values are entered by the line immediately to the left in Column A - without having to do it line by line? Groups are way better than 500 individual lines!
I am currently using Excel 2010. I have a spreadsheet where most of the cells have a VLOOKUP pulling numbers from a separate tab in the same workbook. I am trying to set the cells so that they will change to a yellow fill if their value is not the same as another cell, i.e. J5 not equal to S5; J6 not equal to S6, etc. If the number in S5 changes, I would like it to automatically change J5 to yellow. Currently, I can get J5 to change to yellow when I first apply the conditional formatting and S5 is a different number than J5, but if I change S5 to the same value as J5, it will not remove the yellow fill from J5.
Hello,
This is really strange. The following simple formula works perfectly for me:
It looks strange. There should be a simple formula in your conditional formatting rule:
=$S5<>$J5
Hello Svetlana,
It is possible to highlight current day from a calendar using conditional formatting.
Thanks in advance
Hello Poc,
Of course, you can do this using the following formula:
=$A2=TODAY()
Where A2 is the first cell with a date in the column.
Hi,
How can hightlight the Name as RED where amount is <5000.
Hi!
Select the names you want to color and create a rule with this formula:
=B2<5000
Where B2 is the first cell with data in the Amounts column.
Hi Svetlana,
thank you for your reply, I had actually resolved the problem and was about to inform you when I saw your reply.
The error was part my fault caused when transposing the simplistic example I gave you into the actual values I am using and the use of a semi colon.
Thank you very much for your assistance.
Paul
Thank You Svetlana,
I will try this and provide feedback.
Paul
Hi Svetlana, I have tried your proposed code but it does not appear to work!
The code for Blue is fine, however I cannot get the other two lines to work correctly!
When I enter each of the lines a prompt states that there is an error, I am using excell 2007, is there any other suggestion you can offer.
Thanks Paul.
Hi Paul,
I use Excel 2013, though it should not actually make any difference. The rules work just fine in my sample workbook.
The only possible reason that comes to mind is that you have a semicolon rather than comma set as List separator in your Windows Regional settings, which is the standard for European countries. You can check this in Control Panel > Region and Language > Additional Settings. If this is the case, then you have to replace all commas with semicolons in the formulas.
If this does not help, you can send me your workbook at support@ablebits.com, and we will try to figure this out.
Hi I am trying to improve a document in which I am already using conditional formatting. At present, Cell H9 contains a drop down list of equipments, when nothing is selected in H9 the background is blue, however whenever an equipment is selected the cell is set for no highlighted colour. In Cell H49 I have to record the current software version of the equipment, again if the cell is empty the background is blue, if the software version is correct the background is clear, however if the software version has been superseded this cell reverts to red.
The specific data within H49 is directly related to the data entered in H9, but as yet their conditional formatting is not set up as such, therefore any current version of software is always indicated as being correct, even if the equipment in H9 is not the correct system for the selected software version.
If as an example the systems are called a, b and c and their software versions are 1a, 3b and 4e, respectively, is it possible to produce a formula that ensures the conditional format of H49 is directly related to the specific data in H9 such that:
1. With no entry in H49 the background is Blue (This code is curently in use).
2. Only when H9=a and H49=1a, or H9=b and H49=3b or H9=c and H49=4e, the background is clear(denoting software is up to date).
3. Any other configuration is highlighted red(Incorrect software version for system selected in H9).
If you can assist it would be greatly appreciated. I look forward to recieving a response.
Regards
Paul
Hello Paul,
If my understanding of your task is correct, the following formulas should work a treat.
So, select the cell you want to highlight (H9 or H49) and create 3 rules:
Blue: =$H$9=""
No color: =OR(AND($H$9="a",$H$49="a1"), AND($H$9="c",$H$49="e4"), AND($H$9="b",$H$49="3b"))
Red: =OR(AND($H$9="a",$H$49="a1"), AND($H$9="c",$H$49="e4"), AND($H$9="b",$H$49="3b"))=FALSE
This tutorial or instructions looks great, but doesn't work easier at least for me. I am using Excel 2010, whenever I use the formula |=SEARCH("Due in", $E2)>0| I am getting an error :(
--
Jena
Hi Jena,
What exactly error do you get? This is a very simple formula, and there is absolutely no reason for it to produce an error.
I can think of just 2 possible reasons:
1. Straight quotes in the formula were replaced with smart quotes while copying. Please try retyping the formula directly in Excel.
2. You have a different List separators set in your Windows Regional settings, e.g. semicolon, which is the standard for European countries. You can check it in Control Panel > Region and Language > Additional Settings. If this is the case, the correct formula will be =SEARCH(“Due in”; $E2)>0
If neither is the case, you can send me your sample workbook at support@ablebits.com and we'll try to sort it out.
Hi Svetlana
I am using excel 2007 I am an absolute begginer to excel and I am trying to create a work sheet to map the progress of a given number of tasks to be done to complete one job before moving on and repeating the same tasks to the next job and so on.
C2:K2 are tasks to be done, each I have given their own color.
Apon entering say 091014216(09/10/2014 2.16pm)in the cell under first task I want the intire row to change to that color at the same time adding 10% to K2(% complete)and when I enter say 091014529 in the cell in the next column the color of the row would change from the previous colour to this tasks color (and add 10/20% to K2. And so as the rows get filled with numerous jobs I can at a glance see the the color a particular job is at and and how near completion. I tried the above formula in the new formatting rule window but it only changed the color of the one cell I entered C4 even though I entered =$C4>0. Is this because I`m using 2007 excel? or can this be done?
Hello Joseph,
For me to be able to help you better, please send a workbook with your sample data to support@ablebits.com and specify how you want to highlight the cells.
Hi Shetland
Thanks for your prompt response unlike my own.
Very sorry for not getting back sooner but I am away from my home computer where I have this workbook started. As soon as I am back I will be in touch.
Joe
Svetlana - you're awesome! Thanks so much for the great tutorial. Very helpful in my keyword research efforts - and I will link to this page when I blog about it :-)
nazdrovya
Gary
Thank you very much for your kind words, Gary! Nice to know my article has been helpful.
What if I want to color an entire row with a cell that containing a specific text
Hi Lulu,
This is exactly what this tutorial is about - how to highlight the entire row based on a value in one cell. The following section provides a few example of formulas for text values:
Change a row's color based on a text value in a cell
Hi,
I understand conditional formatting well.
I have set of combinations, each of which corresponds to a row (Say 10 Set with 5 values for each set. So 10 X 5 Table). So If I select any cell in a row, I should project corresponding colour code based on values (5) on this row.
I can do conditional formatting for colour coding. But how can I take a set of input at a time to do so.
Can I do this in Excel?
Hello Shun,
If my understanding is correct, you want to pick the color code of the current cell and use it as the background color for all the cells in this row.
Unfortunately, I don't know the way to fulfill this task using conditional formatting formulas. Most likely, a special VBA macro is needed.
Hi Mam,
i ve to change colour based on a cell value and i couldnt find any answers. for eg., if cell a1 value is 2,the next two coloums must be coloured if it is 3 then next three colums must be coloured. when i increment the cell value the no of colored coloumns must be increased. plz help me...
Hi,
I wanted to learn using formula on color changing in a cell as reminder. For instance, if say a lease for Mr. XYZ expires on 15/12/2014 and i want a reminder 2 months in advance to follow up renewal/non-renewal. How do I do that if I wish the color to change and understand that it is time for a follow up?
Hi, I want each cell in column "D" to be colored Yellow if the value is less than that of the matching cell in that row in column "C". I can do it one at a time but I have hundreds to do. Is it possible to write one conditional format for all?
Hi,
I have problem in solving for the formula. I'd like the three cells have same color with I select name for example "Jimmy".
Date Doc Id Auditor
Please advise for the appropriate formula using the conditional formatting.
Thanks
I work with students and I need to know if they are behind. If I have a cell that has a text value ("Y" or "N") and one that is counting days (45). How would I get the row to change to red if I have a "N" condition and a >21? Thank you for any help.
Hi Erik,
Try this formula:=AND($B2="N",$D2>21)
Where $B2 is the first cell of the Y/N column, excluding headers; and $D2 is the first cell of the Days column.
Thank you for the help. It works perfectly. I have over 140 rows. Is there a way to apply the formatting to work individually with each cell without having to manually go to each cell? Thank you again for your help.
Simply apply that rule to all 140 rows. Click Conditional Formatting > Manage rules, and change the range in the box under "Applies to". Since you use relative row references in the formula (without the $ sign), the rule will be applied to each row individually.
If suppose change the particular cell value from 5 to 3 etc.. now need to highlight color wherever we changed value
Hello Sabarish,
Do you mean you edit the cell manually and you want that cell to change the color once the value is changed? Do you want the cell to keep the color when a workbook is closed and then re-opened?
Wow, thanks a lot for those tips, it will help a lot!!!