Hi!
Let me start by saying I am very new to complex(to me) excel functions. I am a fast learner though. So I have an employee work schedule I've been working on and so far I managed to get it to calculate how many total hours per shift based on times as well as how many hours each employee gets if they take a holiday and to place 0 if the employee is off. I used the following formula for each day:
=IF(ISTEXT(O12),IF(O12="holiday",LOOKUP(O6,T11:T13,U11:U13),0),(P12-O12)*24-Q12)
Where it takes the input from the hours box and if it's a text it checks to see if it's a holiday and if so it checks a small table where each employee's holiday hours are and returns the correct hours. Otherwise it will either return 0 if it's any text except holiday or it will calculate how many hours based on the times input.
What I would also like to do is add SPD (Personal leave) to the mix but that is giving me issues. I adjusted the formula to the following:
=IF(ISTEXT(O12),IF(O12="holiday",VLOOKUP(O6,T11:U13,2,FALSE),IF(O12="SPD",T16,0)),(P12-O12)*24-Q12)
This portion works well except for 1 issue... I cannot change the SPD hours for only 1 day because as soon as I update the dropdown menu on T16 it changes every instance where SPD is and sometimes an employee needs 4 hours one day and 6 another day and I also have 3 employees to schedule and if I update the SPD hours is changes them all and I really don't want multiple dropdown menus. I originally would have liked a prompt anytime you type SPD otherwise just claculate based on the previous Formula.
I know this is a lot of background but here's where I am right now. I tried creating a command button with the following code but I'm extremely limited in my knowledge of commands in VBA so this is all I was able to do for now. Can someone help me figure out a way to accomplish what I want to do?
I would truly appreciate your help in this
Bookmarks