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.
Related
I'm trying to highlight rows created within the past 7 day period (since the last time checked). The table is tied to an external source that formats the column based on NOW (i.e., m/d/yyyy h:mm). So far, I found that conditional formatting is quite finicky when using functions.
First, I'll give the two formulas, which are working now. These are both based on a TODAY() format (i.e., mm/dd/yyyy)
1. =today()>$g2 --- this highlights past due items
2. =DATEDIF(TODAY(),$G2,"d")<30 --- this highlights items due within the next 30 days.
Now I need to reference another column (M), which is based on the NOW format mentioned above. I want the whole row formatted, so I can't use the built in functionality. I've used variations of the above, interchanging NOW() and TODAY(). Additionally, I cannot seem to get AND() to work in conditional formatting of an entire row. Any assistance would be greatly appreciated.
Select the entire sheet first, as conditional formatting only works on selected cells.
Make sure all rows in your sheet are selected.
On the Home tab, in the Styles group, click the arrow next to Conditional Formatting > New rule.
In the New Formatting Rule dialog box, click "Use a formula to determine which cells to format".
Under Format values where this formula is true, type the formula: =$M1>TODAY() . (example provided as your required formula was not provided).
The formula uses the TODAY function to see if the dates in column M are greater than today (in the future). If so, the cells are formatted.
Click Format.
In the Color box, select your colour. Use other formatting commands as required.
Click OK until the dialog boxes are closed.
The formatting is applied to column M when the condition is met.
I have a spreadsheet that is used to track the last date a set of logs was downloaded.
We need to take logs at around the 7 day mark if possible (not critical)..
We have approximately 170 assets that we do this to.
The way the spreadsheet is set up the new date is added to an ever expanding list (rather than just overwriting) i have used conditional formatting to show that a date is less than 7 days old but that cell can be 20 columns accross and is still hard to cross reference to the asset number. I want to highlight column A if any other cell in the same row is highlighted (unless you have a less clunky way of doing it, having the date highlighted really is unimportant it is simply as far as i can get on my own.
I even tried doing a sort by cell colour but that seems to require that i pick one coulmn only.
Thanks for your help.
Conditional formatting will do this for you. I used this example:Column A has dates, Columns B and C have miscellaneous gibberish. (click the link to view the image)
Select the entire range of cells you want to follow these rules (possibly just "select all" to be sure you are getting future additions as well, then choose Conditional Formatting from the ribbon.
Conditional Formatting > Use a formula to determine...
Then enter the following code. =TODAY()-$A2<7 Update $A2 with whatever cell contains your first date value, and be sure to put a $ in front of its column reference so that the formula references only your date column and doesn't wander.Code: =TODAY()-$A2<7
Click the "Format" button to set whatever format you like (I chose yellow fill).
I have text in cell A1 that I want to apply conditional formatting to based on the dates in cells A2:A5. That is if a date in A2:A5 is older than today I want A1 to be filled in red. If the date in A2:A5 is less than 30 days from today I want A1 to be orange. I have tried various formulas and just cant seem to get it to work. Appreciate any help. Thanks
You need to use conditional formatting (button in the home ribbon). Choose new rule and click 'Use a formula'. Enter the formula you want and click format and select the fill colour you want it to be. Click OK. You can do this multiple times with different colours and formulas.
So something like this would make A1 change if A2 was within 30 days:
=$A$2<($A$1-30)=TRUE
But what colour would A1 be if the dates in cells A2:A5 are a variety of dates? Eg. some are less than 30 days some more? The technique above is easy when comparing A1 to one cell. I am not sure you have thought about this or you just have not explained yourself properly.
EDIT:
If A1 is not a static date and you want formatting based on the current timeframe (eg B1 falls within 30 days) then use the Date Occurring feature. Examples of how you can use if below. So you are going to need 12 of these to cover B1:G1 with 30 days for orange and one day for red.
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.
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..