Hi Ravikiran,
To the best op my knowledge it is not possible to create a 'complex' formula with the requirements u have. Though I may be still an amateur in VBA, try this:
Dim AmDays, AveHrs As Integer
Dim Row As Long
With ActiveSheet
For Row = 4 To 16 Step 1
If .Cells(Row, 5).Value...