Can you elaborate in terms of how you intend to use the function in terms of VBA - ie presumably certain elements of the formula will be utilising variables in the VBA etc ?