Were you able to take a look at my response to your question?
Thanks in advance.
Were you able to take a look at my response to your question?
Thanks in advance.
Ive been looking at it, no doubt its possible within a formula its just an awkward one because you have this period of "free days" as such. Its getting the logic of how that works which is causing the issue.
No doubt it'll be something fairly simple but not got it yet!
If someone has helped you then please add to their Reputation
Add this function and then call it (referncing your Days cell) from the Months cell. ie in J13 put =CalcMonths(E13)
Can you test that to see if it gives right results? we can then look at the format of output from there.![]()
Function CalcMonths(inDays) outMonths = 0 outweeks = 0 outdays = 0 Do Until inDays = 0 outdays = outdays + 1 Select Case outdays Case Is = 3 outweeks = outweeks + 1 outdays = -1 Case Is > 5 outdays = 0 End Select Select Case outweeks Case Is = 3 outMonths = outMonths + 1 outweeks = 0 outdays = -11 End Select inDays = inDays - 1 Loop If (outdays < 0) Then outdays = 0 End If CalcMonths = outMonths & ":" & outweeks & ":" & outdays End Function
You've gone quite a ways over my head here, but I think I'm following you.
I added in the function, and the output is now in J13.
I would guess the next step is to somehow separate these outputs into the appropriate cells within the function code? I'm not real familiar with VBA code, so I'm open to next step suggestions.
Thanks again.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks