R
Richard
I need to repeatly use some complicated array functions.
For example, this function which calculates conditional sums and only
returns a value if it is positive:
=IF(SUM(IF(From=$E3,IF(To=H$1,Cost,0),0))-SUM(IF(From=H$1,IF(To=$E3,Cost,0),0))<0,"",SUM(IF(From=$E3,IF(To=H$1,Cost,0),0))-SUM(IF(From=H$1,IF(To=$E3,Cost,0),0)))
Of course, after I enter this formula I have to hit Ctrl + Shift + Enter
Is there a way to convert this into a user defined function like:
Public Function ConditionalSum(Column1Values, Column2Values, Column3Values)
...
...
End Function
For example, this function which calculates conditional sums and only
returns a value if it is positive:
=IF(SUM(IF(From=$E3,IF(To=H$1,Cost,0),0))-SUM(IF(From=H$1,IF(To=$E3,Cost,0),0))<0,"",SUM(IF(From=$E3,IF(To=H$1,Cost,0),0))-SUM(IF(From=H$1,IF(To=$E3,Cost,0),0)))
Of course, after I enter this formula I have to hit Ctrl + Shift + Enter
Is there a way to convert this into a user defined function like:
Public Function ConditionalSum(Column1Values, Column2Values, Column3Values)
...
...
End Function