![]() |
ok, i have over 2000 people on this list, so i simply want to plug in a name, or seniority number and see where this person will be on the seniority list at any given year value i plug in .
if it takes three or more plug ins to do this, thats fine. (in other words, plug in number, get an answer, then use that answer to plug in somewhere to get another answer) |
You've exhausted my Excel skills. I'd use a database and some procedural code to solve that problem. For something so small I'd just use Access and VB.
|
I did a quick and dirty one in five minutes. It's in your inbox.
Legion - email me and I'll send you the sheet. Basically, I create a named value called "offset" by adding n years to today's date. Calculate years of service by subtracting the date of hire from the offset. Then use an IF statement to ask if the age is 60 or less. If true, value is 0, if false, value is -999. Then add the years of service to the result of the IF statement. That way, if the pilot is over 60, their years of service goes to a big negative number, but pilots under 60 have the years of service as normal. Sort on this figure. |
It's quite simple.
Convert the mm/dd/yy into Julian date format - YYYYDDD Today is J-date: 2006073. Excel can do that for you: use the 'format cells - number - date ' option to do so. Pick the format: YYYYDDD. So (#4) mike's DOH is: 1981022. So, say cell A4 is DOH and cell B4 is today's date. (All of column B is the same - B1, B2, B3...etc. is today's date.) Senority is column C4. Forumla for cell C4is: =B4- A4. Propegate that forumla across the whole spreadsheet, as in C1 = B1 - A1, C2 = B2 - A2...and so on. You can use the cut/paste function for this - it will automatically change the row number. In Mike's case, cell C4 turns out to be (2006073 - 1981022) = 25051. Sort by Column C and voila - you have your employees ordererd by senority. Note: you can use today's date, or the date one day after your most recent hire - senority order won't change, just the number will increase or decrease depending on the date you use in column C (I suggest you use today's date, and when you need to redo the spreadsheet, update it with the current date) -Z. |
Z - it's not that hard. Let Excel do the date match, use variables so you don't have to propagate anything, use an IF function to time out the old pilots.
|
Quote:
-Z |
Here, I'll post the formulas:
offset_date = cell where you enter the number of future years, could be zero, could be 5, etc. offset is "=(TODAY()+(offset_date*365))" service is "(offset-D8)/365" where D8 is the relative cell for date of hire too_old is "=IF((offset-E8)/365<=60,0,-999)" where E8 is the relative cell for the date of birth service sort is service + too_old Sort on "service sort" Unfortunately, it does not take leap years into account. I'll have to work on that... ;) |
Will Julian dates help with the leap year problem?? (non-programming background)
|
Quote:
-Z. |
Quote:
Note: you cannot use the "Z-man J-date result" to show anything but order of seniority. You can't really divide that number by anything to get a 'years of service' or anything else. To do that, you'd have to split apart the Jdate into years and days, and do calculations based on those two separate numbers. -Z |
Quote:
|
Quote:
-Z |
No, Mark comes before Chris. Mark is #5, Chris is #6. The other figures are random employee numbers.
The DOB only figures into the time-out (over 60 factor). |
Quote:
Actually, if you just sort the list by DOH, you'll have them all in seniority order! -Z. |
Double post.
Man, I've having a bad day... already... -Z. |
snake, what is your email? i will send you my simple one.
you will be able to rank either by number of years service or age. the data>sort>decending button is your friend:) |
I improved my quick and dirty version to include a control button that invokes the sorting macro. Simply enter the years in the future you wish to determine the seniority, and press the button "Rank".
For those interested, the spreadsheet is posted here. |
don, looks like you re getting there!!. Now i need a cell, that will add up the people. or better yet, i just sent it to you.
Thanks! |
very similar to the one i cranked out. nice, don!
|
You should see the one I just cranked out....
Used the Seniority Number to find the person, then took advantage of the "Match" function to determine the rank more directly. Then had to figure out VB code to run a button on a different sheet. Now to figure out how to count the valid pilots and tell someone if they are too old... Edit: Got it. Did that with the CountIF function.... |
| All times are GMT -8. The time now is 02:27 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0
Copyright 2025 Pelican Parts, LLC - Posts may be archived for display on the Pelican Parts Website