I call this function to calculate current months of coverage.
It compares 1 column (Inventory ) to a range of cells ( future forecast ) and give me a current month's of coverage:
Function coverage(inventory, forecast)
Application.Volatile
For Each c In forecast
inventory = inventory - c.Value
Select Case inventory
Case Is > 0
coverage = coverage + 1
Case Is = 0
coverage = coverage + 1
Exit Function
Case Is < 0
If c.Value <> 0 Then
coverage = coverage + (1 - (Abs(inventory) / c.Value))
Else
coverage = coverage
End If
Exit Function
End Select
Next c
End Function
it works beautiful...
So I call it like this:
=coverage(C1,CE:CM)
I want to be able to do 1 small adjustment:
=coverage(C1,(ce*.23):CM )
So I am only taking a portion of the first month
any ideas ?
It compares 1 column (Inventory ) to a range of cells ( future forecast ) and give me a current month's of coverage:
Function coverage(inventory, forecast)
Application.Volatile
For Each c In forecast
inventory = inventory - c.Value
Select Case inventory
Case Is > 0
coverage = coverage + 1
Case Is = 0
coverage = coverage + 1
Exit Function
Case Is < 0
If c.Value <> 0 Then
coverage = coverage + (1 - (Abs(inventory) / c.Value))
Else
coverage = coverage
End If
Exit Function
End Select
Next c
End Function
it works beautiful...
So I call it like this:
=coverage(C1,CE:CM)
I want to be able to do 1 small adjustment:
=coverage(C1,(ce*.23):CM )
So I am only taking a portion of the first month
any ideas ?