Basically I need to have a macro fill in a formula based on if a value exists.
So for this example cell M2 contains the following formula:
`=IF(AND(D2>$O$1,D2<$P$1),D2-$O$2,IF(AND(D2>$P$1,D2<$Q$1),D2-$P$2,IF(AND(D2>$Q$1,D2<$R$1),D2-$Q$2,IF(D2>=$R$1,D2-$R$2,""))))
And cell N2 contains the following formula:
`=IF(AND(D2>$O$3,D2<$P$3),D2-$O$4,IF(AND(D2>$P$3,D2<$Q$3),D2-$P$4,IF(AND(D2>$Q$3,D2<$R$3),D2-$Q$4,IF(D2>=$R$3,D2-$R$4,""))))
What I need is someway to check if $J$2-d2 >2
Cell L2 contains the difference between the employees time and the average shift length. (which would be the number 2 after the > in the example above)
If there would be anyway of making the number 2 variable with the use of a text box or something that would be even better.
Bookmarks