N
Niki Odolphi
I want to change a formula to a VBA function. So instead of:
=IF(ISERROR(AVERAGE(V10:V13)),"",AVERAGE(V10:V13))
I want to use:
=myaverage(V10:V13)
Any ideas ? I have tried just converting this to a function almost
word for word and it still doesn't work.
Function monthavg(monthfigures)
If IsError(Application.WorksheetFunction.Average(monthfigures)) Then
monthavg = ""
Else
monthavg = Application.WorksheetFunction.Average(monthfigures)
End If
End Function
=IF(ISERROR(AVERAGE(V10:V13)),"",AVERAGE(V10:V13))
I want to use:
=myaverage(V10:V13)
Any ideas ? I have tried just converting this to a function almost
word for word and it still doesn't work.
Function monthavg(monthfigures)
If IsError(Application.WorksheetFunction.Average(monthfigures)) Then
monthavg = ""
Else
monthavg = Application.WorksheetFunction.Average(monthfigures)
End If
End Function