The help page I sent was to explain how to use Excel's built in worksheet functions in VBA. You are correct that the example they gave was for a Sub procedure (aka macro) that used a message box to return the result. The same basic approach can be used for returning the result to a spreadsheet. Adapting their example to a UDF (function procedure called from a spreadsheet):
From there, you will need to replace "Min" with the functions you are interested in and include the additional operations needed for your calculation.
Bookmarks