Hi Mark!
Glad you like it! I'm happy to help you with your wish list, although my time is a bit limited this week.. in other words, I may be slow in replying.
To create a link, you can just paste a URL into your reply and it will be clickable. To have link text you have to use some HTML codes, but you needn't worry about that. I uploaded the file to Google Docs, but any file sharing site works.
Is there a way to automatically color code the day "Cell" for the first day of the pay period which is Sunday biweekly? Thanks for all your help.
Sure. You could use another conditional formatting rule.
When you use a formula for a conditional format rule, you can use nearly any formula you can use in a cell in a spreadsheet, but you want the result of the formula to be TRUE or FALSE. When the result of the formula is TRUE, the format you select gets applied.
The formula
In a conditional format rule will always apply the formatting, although that's not very useful.
A conditional format formula can have both relative and absolute cell references. When you create a conditional format rule for a range of cells, you enter the formula with cell references as they should appear in the top left cell in the selected range. Absolute references will stay the same for all the other cells in the range, and relative references will change/be evaluated differently for the other cells, in exactly the same way they would were you to enter that same formula in those cells on the spreadsheet.
I recommend writing a formula that can determine whether a given day is the first day of the pay period in a cell on the spreadsheet, first. It sounds like the relevant information is the date and/or day of the week. You will have to do some calculations.
Once you have the right formula, and it results in TRUE on your spreadsheet, on the appropriate days, when in any row while in columns C:AG (or whatever the same columns are that your conditional formatting is intended for), you can just copy that formula as it looks in the first of those columns and paste it into the formula entry for a conditional format.
If you look up "date and time functions" in Excel help you might get some ideas. Some additional info that could be useful:
Dates and times are stored internally as a "date serial number", simply a never-ending count of days since 12:00 AM on January 1, 1900, or in some cases, 1904 (which are considered serial number 1).
This means you can do ordinary arithmetic with dates and times, and the result will be in terms of days.
The DATE(y,m,d) function converts a year, month, and day to a date (date serial). WEEKDAY(date[,return type]) returns the day of the week of a date serial, represented numerically (1 being Sunday by default). YEAR(date), MONTH(date) and DAY(date) extract that info back out of a date. To determine the number of weeks between dates, you could take the difference between the two dates and divide by 7. Divide by 14 to count how many two week periods. To determine if it's been
exactly two weeks or a multiple thereof, you wouldn't need to know how many periods between the dates, but you would want to make sure there is no remainder/fraction after dividing by the number of days in a period. For that, you can use the MOD(number, divisor) function, which returns the remainder of number/divisor, or you can check if (number/divisor)=INT(number/divisor).
See if you can come up with a formula yourself, if you get stuck, let me know the sticking point.
It's true that my assignments change given the day of the week. Is it possible to have the different assignments follow the day of the week when i change the month?>
Yes. But that suggests entering the daily available assignments somewhere else besides at the bottom of the schedule, where you will then enter your assignments for just 7 days, instead of for every day in the month. Then you could use formulas in the "Available Assignments" area to lookup the assignments for that day of the week using VLOOKUP, INDEX and MATCH functions, or some other lookup method.
I was playing some more with the sample file since I first uploaded it, mainly because I was inspired by a recent discussion on this forum about advanced use of lookup formulas to create sorted lists, and by the fact that your sample data that you posted appeared to show the available assignments left for any day without any gaps between them, immediately under the line. With our spreadsheet I created a separate table of available assignments, and came up with a formula for the Available Assignments area that does just that. Instead of using conditional formatting to hide used assignments, they simply are not included in the list anymore, and the list will change as you add/delete assignments. Since unavailable assignments are
actually not on the avail. assignments area of the spreadsheet anymore, I was able to change the data validation rule for the cells where you enter the assignments from using a formula to using a list of available values (the same list you see in the avail. assignments area). This places the same restrictions on what you can enter, but has a bonus of providing a pop up list/listbox next to each cell as you click/move between them that you can select from instead of typing the assignment code, if you wish. Now, it currently uses a single list of available assignments and applies them on every day of the month, but I anticipated that it would require additional modification to be more flexible than that.
I haven't had time to make sure what I described all works without hitches, so I hesitate to share it with you until I do.. Let me know if you are interested in seeing that, or if you prefer to work this out on your own/with support.
Some things I wondered about changes in available assignments: (1) might they change from time to time.... including in the middle of a month, as your needs change (2) is there a regular, predictable schedule (you've basically answered that with your question - yes I think) (3) might you still want to override the usual plan?
The answers to those questions help to decide the best way to achieve all your needs.
I love the error message!!
Is there a way for that message to pop up if I've scheduled an employee more then 10 days in the same biweekly pay period?
Yes
That message is part of the data validation rule. You can only have one data validation rule for any given cell, but you can have that one rule check any number of conditions. Your conditional formatting formula for identifying pay period changes should be helpful in developing a modification to the data validation rule to achieve what you want. In fact, since you need to identify pay periods for both the data validation purposes and conditional formatting, I think it might be a good idea to put the formula to determine pay period or pay period changes in a row of it's own on the spreadsheet (the row could be hidden) and refer to it with your conditional formatting and data validation formulas both. The data validation solution could probably be done with a COUNTIFS formula.
Code:
=COUNTIFS($C$31:$AG$31,C$31,$C4:$AG4,"<>")<=10
Provided C31:AG31 contains a unique value, specifying the pay period...
C4:AG4 and other rows below that contain the area to apply data validation...
The above formula is a valid data validation rule intended for a range with top left cell C4. It will return true only if 10 or fewer matches between the existence of assignments on the current row, C (given employee) and the same pay period as the current column's, as found in row 31.
The current data validation rule
Code:
=AND(COUNTIF(C$4:C$18,C4)=1,NOT(ISERROR(MATCH(C4,C$19:C$30,0))))
checks two conditions, see if you can see how to add the third. The first trial will be calculating the pay period, though!
It's OK, ask as much as you like! In some cases you may prefer to start a new topic for different problems, but this works for me for now. Feel free to answer some questions yourself, if you are so inclined.
Welcome to Chandoo forums! Personally, I posted here a month ago to get help with a problem of my own, and quickly found I liked this small, friendly, and a bit laid back community. Make sure to check out, if you haven't already, the rest of the site. Chandoo himself is a good teacher (based on my experience reading his articles and his occasional forum responses), has perhaps hundred of articles and blog posts up, and offers online classes.
Oh! By the way, to have your text aligned, as you tried to do with your sample data, you can use the backquote (on the tilde key). Placing a backquote before and after the text will use a monospace font. For some reason, it doesn't retain leading spaces on the first line of text, but thereafter it does. For other formatting of forum posts, you can use any of a few html-style markup codes. They're listed below the text entry box when you type a post. Took a bit of getting used to for me
You can edit your posts for a bit after you post them (I think up to an hour), and then they are fixed for perpetuity.
Asa