Automatically a cell of a week - excel

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.

Related

Excel Conditional Formatting, based on difference of 2 cell calculation

I've been trying to create a conditional formatting based on calculation of 2 cell.
The logic is, if the current month increases/decreases more than x or -x from previous month, then it will highlight or change or even better if I can use icon to show it.
So for example, for the month of march, since it decreases more than 2pts, than the cell should turn red. And for the month of Feb, since it increases by 2pts, then the cell should turn green.
Is there any way to do this? and Copy Paste this through the table?
you could use the following formulas for conditional formatting starting in feb:
=(b2-a2)>2 set the format to fill in green
=(b2-a2)<2 set the format to fill in red
and then use format painter to copy that formatting for the other cells.

Conditional formatting: automatically refer to the next cell?

I have a schedule with team member names and the column headers are half hour time intervals. I want to shade the cells of hours each person does not work with gray according to their shift schedule, so that I know not to schedule that person during that hour.
I have created a separate table with each person's shift schedule, and the names appear in the same order as in the schedule.
Is there any way to conditionally format the cells at once? There has to be an easier way then what I am doing now...which is one by one clicking on each person's cell and creating the formatting formula.
I can't copy paste the formatting because the formula still refers to the previous person's shift on the other table. I need it to refer to the next row.
The formula I use for conditional formatting is:
='Job Functions'!$O$5>$C$9
Where Job Functions is the sheet that contains the shifts, O5 is the shift assigned to that employee, and C9 is the column header on the schedule (6:30am). I just clicked on the cell and created a new conditional formatting rule from the excel ribbon on top...no vba.
If there is a VBAsolution to this that'd be great! I'm fairly new to VBA
Conditional formatting works like this
Let's say I have an array of numbers in A2:E5 and a header row in A1:E1. I want to have my array of number be green if the value of the cell is greater than it's column header. That is to say I want to compare A2>A1, B5>B1, D4>D1, etc. this means I want the header row comparison to be constant.
In Excel formulas you use the $ symbol to maintain constant references. Since I want the row to stay constant but I want the column to be relative to the cell in my array of numbers my header reference will be A$1 (column is relative, row is locked).
This is just the formula used to determine if formatting will be applied or not. If it returns true then the conditional formatting is applied, if it returns false then nothing happens.
However, where the formatting is applied is determined by the Applies to reference. In my example below I am applying the formula A$1<A2 to $A$2:$E$5. This means that in the cell A2 the formula A$1<A2 is used to determine if formatting is applied, but in B3 the formula B$1<B3 is applied. This is the same logic as if you were to have dragged the formula itself into these cells.
If instead my Applies to formula were $B$2:$E$5 this means that B2 would be colored green if A$1<A2, and B3 would be colored green if A$1<A3.
So with all that your formula should probably be
='Job Functions'!O5>C$9
drag and drop it down to fill the other cells

Excel- I want to use conditional formatting to turn names yellow if they have dates that are past do in their row

I have a spredsheet with employee names listed down column B, in column E-EE I have classes listed in the top row and dates the class expire throughout the table, I used conditional formatting to color dates that will expire within 6 months Yellow, dates that are expired Red. IF a person has any yellow or Red dates in their row, I want the name to turn Yellow.
https://drive.google.com/open?id=0B0-TURIN7pKBQVV1cThnUnpIQjA
The Link is to a file with the conditional formatting for the part i can do done, I need to make the names turn Yellow if they have yellow or red in their row.
Set your conditional formatting for the person's name cell and use formula as the method. for the formula use:
=SUMPRODUCT(($D3:$S3<NOW()+DATE(0,6,0))*($D3:$S3<>""))>0
You may need to change the reference range. IF you select all the names and the top name is the active cell, you can use this formula as long as the row numbers are not locked and they have been updated to be the same row as the active cell in the selection.

Excel dynamic conditional formatting based on cell version 2

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.

Format a cell that is referenced by another cell

I need to format a cell that is specified by another cell. Basically after many calculations, the cell AL1 contains a cell reference, in this case it is AD48. I want to format cell AD48 and fill it red. This cell reference can, and will change so tomorow it may be AD54. I would then want only cell AD54 to be filled red and not AD48 anymore.
So basically whatever cell is specified in AL1, I want to format that cell (in this case fill it red)
ALOT of googling and no answer. Any help much appreciated!
Select sheet (click triangle immediately to the left of ColumnA and immediatley above Row1), Home > Styles - Conditional Formatting, New Rule, Format only cells that contain, Cell Value equal to =$AL$1, Format, Fill, Red, OK, OK.
Edit following clarification of requirement:
Change to Use a formula to determine which cells to format and apply
=SUBSTITUTE(CELL("address",A1),"$","")=$AL$1
Edit to add image of part of file uploaded by OP and some CF clarification.
Edit OP has an answer that works but posted this as a link in a comment. There is a solution that does not require formulae in AH1:AJ4 now that AA3 contains =TODAY():
=OR(AND($C5=TEXT($AA$3,"mmmm"),C8=DAY($AA$3)),AND($C4=TEXT($AA$3,"mmmm"),C7=DAY($AA$3)))
in Format values where this formula is true: and Applies to =$C$7:$AG$125. (Now formats both day of week and date of month).
Edit. Attempt at clarification (that should have been provided before!)
Selecting C7 as the start point, the formula for conditional formatting checks whether A or B is true:
A] Both the month name (in C5) matches the current month (long form) of =TODAY() in AA3) and the cell immediately below (ie C8) matches the day in AA3,
Or
B] Both the month name (in C4 – that is merged with C5) matches the month and the current cell (C8) matches the day in AA3.
Either case triggers the conditional formatting – hence this is applied in pairs of vertically adjacent cells.
Since the spreadsheet is well laid out (each month 11 rows and Day1 always in ColumnC) this same formula can be applied throughout with the nature of conditional formatting taking care of adjusting the relative references to cells in ColumnC up to the specified limit of Row 125 and in Row7 (or 8) for columns up to the specified limit of AG.

Resources