This tutorial explains how to use Excel formulas to format cells and entire rows based on the values you specify or based on another cell's value, and provides a handful of formula examples. Continue reading
by Svetlana Cheusheva, updated on
This tutorial explains how to use Excel formulas to format cells and entire rows based on the values you specify or based on another cell's value, and provides a handful of formula examples. Continue reading
Comments page 9. Total comments: 1062
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"
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 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.
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.
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.
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"))
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 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 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?
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))
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)
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.
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.
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.
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")
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!
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.
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.
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.
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)
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! :)
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
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, 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.
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)
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
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:
https://www.ablebits.com/office-addins-blog/excel-pivot-table-tutorial/
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.
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.
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 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..
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.
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
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))
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.
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.
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 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
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.
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:
https://www.ablebits.com/office-addins-blog/excel-vlookup-tutorial/
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.
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 : )
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
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 A is not empty and if the cell in column B is greater than in column A:
=AND($A1<>"",$B1>$A1)
If a cell in column B is 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:
https://www.ablebits.com/office-addins-blog/relative-absolute-cell-references-excel-conditional-formatting/
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:
https://www.ablebits.com/office-addins-blog/excel-countif-function-examples/
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
That was exactly what I was looking for. Thank you so much. This will help so much.
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'.
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.
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!
Thank you!
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.
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?
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
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.
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
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
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.
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.
Where is this pulling my picture from? That is creepy...
Hello,
The picture is automatically pulled from gravatar.com (Globally Recognized Avatar).
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"
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.
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 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.