I'm embarrassed to ask. Skip, if you read this, please cover your eyes.
This is related to my question, thread68-1772892
Here's some sample data as to what I have to work with:
[pre]
[A] [C] [D] [E] [F] [G] [H]
MonthName XtraTime OnCheck TimeOff Balance Earned FinalTime FirstDayOfMonth
January [formula] manual 1/1/2017
February [formula] =F2+B2 2/1/2017
March [formula] =F3+B3 3/1/2017
April [formula] =F4+B4 4/1/2017
May [formula] =F5+B5 5/1/2017
June [formula] =F6+B6 6/1/2017
July [formula] =F7+B7 7/1/2017
August [formula] =F8+B8 8/1/2017
September [formula] =F9+B9 9/1/2017
October [formula] =F10+B10 10/1/2017
November [formula] =F11+B11 11/1/2017
December [formula] =F12+B12 12/1/2017
[/pre]
Sorry I didn't bother filling in the other times, but it's basically all times listed in HH:MM - so examples can be in any field: 100 hours and 30 minutes shown as 100:30.
To the right of the above region, I have a new region I added to help make things easier to understand what I'm doing. That section looks like:
[pre] [J] [K] [L]
Worksheet F.LastName Extra Hours
Anniversary 6/2/2003
6 Years 6/2/2009 8:00
15 Years 6/2/2018 80:00[/pre]
The concept shown here is basically after 6 years, an employee gets an extra 8 hours time off, and then each year thereafter, that bumps up 8 ours per year until maxing out at 15 years service, where thereafter, it's an extra 80 hours each year.
In Column B is the problematic formula. I have times listed all over the sheet in HH:MM but in the formulas I have in column B, in one of the conditions, the Excel calculations do not like my attempt at math. I am sure that I just need to use some additional functions to tell it that I want to multiply the hours and minutes by an integer to come up with hours and minutes. I imagine I need to convert the hours and minutes to just minutes or seconds, do the calculation, and then convert back to hours and minutes.
The formula looks like this:
I am certain the issue is in the [highlight #FCE94F]*8[/highlight] piece. I built this formula for a personal workbook I already put together for myself, and I'm trying to convert it to work for everyone else. Of course, I've got to go back and change mine sometime now to keep tit for tat with what the company uses.
I'll dig back into this first thing tomorrow morning.
The general concept is:
Take the number of difference between an employee's anniversary date and the date of the given month, and if that's between 6 and 15, multiply 8 times that number. 8 is the number of hours added for each additional year of service between 6 and 15.
I think the fix will be to convert the HH:MM time to seconds, run the multiplication, and then convert back to HH:MM.
If any of you have a better mousetrap in mind or other suggestions, I'm all ears. Thanks in advance for any thoughts.
Yes, I realize I'll probably be embarrassed if/when one of you points out something simple I'm missing.
"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
This is related to my question, thread68-1772892
Here's some sample data as to what I have to work with:
[pre]
[A] [C] [D] [E] [F] [G] [H]
MonthName XtraTime OnCheck TimeOff Balance Earned FinalTime FirstDayOfMonth
January [formula] manual 1/1/2017
February [formula] =F2+B2 2/1/2017
March [formula] =F3+B3 3/1/2017
April [formula] =F4+B4 4/1/2017
May [formula] =F5+B5 5/1/2017
June [formula] =F6+B6 6/1/2017
July [formula] =F7+B7 7/1/2017
August [formula] =F8+B8 8/1/2017
September [formula] =F9+B9 9/1/2017
October [formula] =F10+B10 10/1/2017
November [formula] =F11+B11 11/1/2017
December [formula] =F12+B12 12/1/2017
[/pre]
Sorry I didn't bother filling in the other times, but it's basically all times listed in HH:MM - so examples can be in any field: 100 hours and 30 minutes shown as 100:30.
To the right of the above region, I have a new region I added to help make things easier to understand what I'm doing. That section looks like:
[pre] [J] [K] [L]
Worksheet F.LastName Extra Hours
Anniversary 6/2/2003
6 Years 6/2/2009 8:00
15 Years 6/2/2018 80:00[/pre]
The concept shown here is basically after 6 years, an employee gets an extra 8 hours time off, and then each year thereafter, that bumps up 8 ours per year until maxing out at 15 years service, where thereafter, it's an extra 80 hours each year.
In Column B is the problematic formula. I have times listed all over the sheet in HH:MM but in the formulas I have in column B, in one of the conditions, the Excel calculations do not like my attempt at math. I am sure that I just need to use some additional functions to tell it that I want to multiply the hours and minutes by an integer to come up with hours and minutes. I imagine I need to convert the hours and minutes to just minutes or seconds, do the calculation, and then convert back to hours and minutes.
The formula looks like this:
Code:
=IF(MONTH(H3)=MONTH($K$3),IF(YEAR(H3)<YEAR($K$4),"",IF(YEAR(H3)<YEAR($K$5),[highlight #FCE94F](DATEDIF($K$4,H3,"Y")+1)[b]*8[/b],$L$5))[/highlight],"")
I am certain the issue is in the [highlight #FCE94F]*8[/highlight] piece. I built this formula for a personal workbook I already put together for myself, and I'm trying to convert it to work for everyone else. Of course, I've got to go back and change mine sometime now to keep tit for tat with what the company uses.
I'll dig back into this first thing tomorrow morning.
The general concept is:
Take the number of difference between an employee's anniversary date and the date of the given month, and if that's between 6 and 15, multiply 8 times that number. 8 is the number of hours added for each additional year of service between 6 and 15.
I think the fix will be to convert the HH:MM time to seconds, run the multiplication, and then convert back to HH:MM.
If any of you have a better mousetrap in mind or other suggestions, I'm all ears. Thanks in advance for any thoughts.
Yes, I realize I'll probably be embarrassed if/when one of you points out something simple I'm missing.
"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57