You can do that in the spreadsheet but its probably easier with a custom VBA
function:
Public Function MDIETZ(dStartValue As Double, dEndValue As Double, iPeriod
As Integer, rCash As Range, rDays As Range) As Double
'Jelle-Jeroen Lamkamp 10 Jan 2008
Dim i As Integer: Dim Cash() As Double: Dim Days() As Integer
Dim Cell As Range: Dim SumCash As Double: Dim TempSum As Double
'Some error trapping
If rCash.Cells.Count <> rDays.Cells.Count Then MDIETZ =
CVErr(xlErrValue): Exit Function
If Application.WorksheetFunction.Max(rDays) > iPeriod Then MDIETZ =
CVErr(xlErrValue): Exit Function
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.