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.
Related
i'm newbie in excel and i have an excel sheet where i need to change the cell color if the date mentioned in the cell is becomes 15 days old and also add a status in next column as pending.Please help with this.
Assuming your dates are in ColumnA, please select that column and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=TODAY()-A1>=15
Format..., select your choice of colour for formatting, OK, OK.
If the "pending" labels re then to be added in ColumnB where appropriate please put in B1 and copy down to suit:
=IF(TODAY()-A5>=15,"pending","")
You could use the pending in ColumnB to trigger the colour for ColumnA but it may be better to keep the two requirements separate. If you were to trigger via 'pending' you would still need a formula rule, rather than a "cell content" one.
Change 15 to 20 when you have decided what the interval should be. Beware that if your ColumnA values include times (even if not displayed) you cannot reliably simplify >=15 to >14.
This is the formula you might be looking for:
=IF(DAYS(TODAY(),A1)>=15,"pending",other_status_you_use)
Then you should go to
Conditional Formatting > Highlight Cell Rules > Text that Contains...
There you can type pending and change the color as you wish.
First thank you and sorry as I am very new at this.
I need to have a cell come up red if blank, based on another cells entered date plus "X" number of days.
Example:
If A2 shows 2/1/16 and B2 is blank (greater than 2 days from A2) I need it to come up red. So if today's date is 2/5/16 this cell would become red.
If A2 shows 2/1/16 and B3 is blank (by greater than 4 days from A2's date) I need it to come up red.
If a cell is blank and it is not greater than the number of days I set, it remains unchanged. (A2 shows 2/1/16 and today is 2/2/16, B2 would remain blank) Also if a date is entered and it is greater than the number of days I set as compared to A2 it would also come up red. (A2 is 2/1/16 and B2 shows 2/5/16)
Thank you in advance!
This answer was posted by #assylias in the comments and the author said it was the solution. I slightly formatted the steps so they are easier to follow.
Select the cell you want to colour
Go to conditional formatting
In the formula add something like =TODAY()-A2<3 and choose the formatting you want.
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.
Trying to set up a bit of a to do list with conditional formatting dates. Any time I open the file B2 will load =today()'s date. What I'm hoping to do is find a formula that will allow something like if C2 < B2 (Over due) then conditional formatting rule, or if C2 is 7 days more than B2 then format rule 2.
Not sure how to proceed with this as =today() isn't being treated like numeric data.
Any suggestions?
Thanks!
To apply to C2, select it and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=C2<B2
Format..., select choice of formatting, OK, OK.
Then repeat with:
=C2=B2+7
and (presumably) a different choice of formatting, though could be the same (in which case a single rule would be sufficient).
Beware if C2 contains time as well as date the second rule above will not work (and not that formatting will only work for 7 days time, not 6 nor 8 ahead etc, only seventh day from today not counting today).
TODAY() could be part of the formulae (if adjusted) - does not need to bein a separate cell.
To apply to ore than one cell (eg an entire column) is quite possible with slight adjustments.
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.