I have a spreadsheet that I would like columns that relate to Saturday and Sunday to automatically colour fill. As the months and years change I would like for the formatting to recognise the weekends and fill the columns accordingly.
Kunal, I take it that the dates/weekdaynames come from the date-number in row 1, which you have formatted to show the weekday. In that situation, I would select e.g. the first column (all cells are highlighted), then select conditional formatting, new rule, Use formula to determine which cells to format and put the following formula in:
=WEEKDAY(A$1,2)>5
and select the background color.
Make sure the first column is selected and use format painter to copy the conditional formats to the other columns.
What this does is look at the date number in row 1 and calculate the weekday number where Monday = 1 up to Sunday being 7. Any value above 5 is therefore Saturday or Sunday.
In excel 2010
Select column that you want to format
Click the Home tab.
In the Styles group, click Conditional Formatting
Select ' new rule '
Select a rule type = Format only cells that contains
In format Only cell with,set cell value to 'equal to' Sunday
Click on format button and select Fill tab
Repeat above steps for Saturday also
If you want to do changes in this rule afterwords, click Conditional Formatting and select ' Manage Rules '
Hope this will help you..
Related
I am stuck on a conditional formatting question. So I have a dynamic calendar template in which you can change month and week etc. The dates only range from column E to column X. It looks like this:
The 11th row is the date row, and the orange cells are dates which are holidays. The conditional formatting to color those cells is:
=COUNTIF(holiday,E$11)>0
where holiday is a named range containing the list of holidays.
What I would like to do is color the rows below as well when the date is a holiday. So in this case, if 13th may is a holiday, I12:I17 should also be colored orange.
Any help will be appreciated. Thanks
Edit: As #SRA suggested, if I select the whole E11:X17, it solves my problem halfway as posted:
What I also wanted was to get rid of the text which is coming through conditional formatting, not the text of the date which is the 11th row, but the text of the below rows if its a holiday.
Thanks a lot
You could select the entire range I12:I17 and then apply the conditional formatting
EDIT:
Do the following 2 steps
1) Selec I11 and apply the below formatting
(ONLY BACKGROUND IS ORANGE)
2) Select I12 : I17 and apply the below formatting
(BAKGROUND and FONT both orange)
I am trying to compare pages of employee hours verses sales. In order to catch myself if I record sales and not hours, I'd like the hours cell for a given date to highlight itself, if the sales cell has a value.
Here's an example of the "hours" sheet:
2-Nov 3-Nov 4-Nov
Smith Judy 0.8 7.25 0
And an example of the "totals" sheet:
2-Nov 3-Nov 4-Nov
Smith Judy $15.72 $76.55 $82.13
The problem would be that Judy is listed as selling $82.13 (E2) in product, while having worked 0 hours (E2) according to the "hours" sheet.
Is there a conditional formatting formula that I can use to get Excel to highlight the "0" listed under 4-Nov on "Hours"?
Is there a conditional formatting formula that I can use to get Excel to highlight the "0" listed under 4-Nov on "Hours"?
Yes. If you want to highlight the "0" on the "Hours" sheet, you can use conditional formatting where the formula includes a reference to a cell on a different sheet.
For example, click on the Hours sheet cell E2. Go to Conditional Formatting -> New Rule -> Use a Formula to Determine Which Cells to Format and paste a formula in the "Format values where this formula is true:" box there, like:
And(E2>0,totals!E2 =0)
Then click the Format button below it on the right, activate the Fill tab, and click what color you want the cell to be highlighted in.
Thanks to Scott Craner's comment on the question for providing an improved formula.
Rather than just formatting a singe cell, I suggest selecting all the relevant columns in hours (presumably starting with C) and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=AND(OR(C1="",C1=0),NOT(ISBLANK(totals!C1)),NOT(ISBLANK($B2)))
Format..., select your choice of highlighting OK, OK.
This warns even when blank rather than 0 in hours but relies on names such as Judy to avoid extending to empty rows. It also allows for values in totals of nil or negative (in case of adjustments).
I am trying to do conditional formatting on the below example.
I would like to highlight certain columns/cells based on the day of the week. For example, if the date is a Tuesday, then I would like the WeHo, Sunset, WW, MB, Irvine, BrentW, Cienega and Hun B columns highlighted. If possible I would like to base the day of the week off the pre-existing date in cell A2, since we do our work one day before hand (working on a Monday, but cells are highlighted as if the actual date was Tuesday).
Assuming that the date in A2 is a Monday and you want B2:B20, E2:E20, J2:K20, Q2:Q20 and T2:U20 to be formatted then please select those ranges (with Ctrl depressed) and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=WEEKDAY($A$2)=2
Format..., select your choice of formatting, OK, OK.
Sounds like you want to use formula conditional formatting. Basically, go to the formula conditional formatting and =$A$2="Tuesday" then click ok and make the "apply to" apply to the column you want highlighted when A2 says it's a Tuesday.
I am creating a spread sheet that should automatically highlight cell in as color green.
As you can see in the attached, the cell to be automatically shaded green should represent the week in that month when a child should turn 1 year.
I don't know if its just formula in Excel or writing some macro to do this whenever a new entry is done.
This can be done with conditional formatting. Highlight the range under the header row and right of the the dates.
Assuming your data starts with the first date in A2, and first week number in C1...Then go to Conditional Formatting, and add this under a custom rule =weeknum($A2)=C$1. Then choose green for the fill, and apply!
Or change it to =weeknum($B2)=C$1 if you want to base the weeks off the 1 year mark.
A few months back I posted the following question Conditional formatting rows based on cell dynamic.
At the time the formula provided was fantastic and still is however I'm redeveloping the spreadsheet and need something similar but I just can't figure out a solution.
I currently have a list of times in column A in increments of 1 hour from 9am to 9pm. In column B I would type 2 next to 9am it would somehow highlight 9am and 10am, now under that say you type 7 next to 11am it would highlight 11am, 12pm 1pm 2pm 3pm 4pm 5pm.
Hope that makes sense
Many Thanks
This would seem to require the Use a formula to which cells to format option when creating a new CF rule.
Select A2:B14 with A2 as the Active Cell and choose Home ► Styles ► Conditional Formatting ► New Rule. Select the Use a formula to which cells to format option and supplt the following for Format values where this formula is true:
=AND($A2>=INDEX($A$2:$A$14,MATCH(1E+99,$B$2:$B2)),$A2<(TIME(VLOOKUP(1E+99,$B$2:$B2,1),0,0)+INDEX($A$2:$A$14,MATCH(1E+99,$B$2:$B2))))
Click Format and select some formatting. I chose an orange Fill. Click OK to save the formatting choice(s) and then OK again to create the new rule. You should be left with something similar to the above sample image.