Hi I'm new to building custom functions, and am currently trying to build one that can calculate total numbers of days before a certain date that an employee would start.
The format that dates are given in is something like "7.2" which would mean 7 weeks and 1 day making it 36 days total which is the result I'm trying to get. The whole number which varies would always be multiplied by 5, and the decimal would always either be .2, .4, .6, .8, or 0.
I'm been able to get the decimal section to work but haven't been able to figure out how to get the whole number to work as well as calculate the decimal at the same time. Any suggestions or ideas would be appreciated.
The format that dates are given in is something like "7.2" which would mean 7 weeks and 1 day making it 36 days total which is the result I'm trying to get. The whole number which varies would always be multiplied by 5, and the decimal would always either be .2, .4, .6, .8, or 0.
I'm been able to get the decimal section to work but haven't been able to figure out how to get the whole number to work as well as calculate the decimal at the same time. Any suggestions or ideas would be appreciated.
Function PrepWkCalc(CellRef)
Select Case CellRef
Case Is = 0.2
PrepWkCalc = 1
Case Is = 0.4
PrepWkCalc = 2
Case Is = 0.6
PrepWkCalc = 3
Case Is = 0.8
PrepWkCalc = 4
End Select
End Function