MODERATOR NOTICE: This topic has also been posted on other sites and may already have an answer elsewhere. Please take this into consideration when answering this question
Can someone help make a UDF code that will do the following:
Note: Only VBA code to be used and no reference to any Excel functions required such as Application.Worksheet Functions. Any built-in VBA functions can be used such as sqr.
1. Base Data: Have 3 columns of indefinite length. Column1: Company Name, Column2: Rating, Column3: Coupon
2. Input will be two ranges of data i.e. Rating and Coupon.
3. It should be callable from within Excel (i.e. from a cell of worksheet).
4. Output requirements:
i) Code should identify all unique Credit Ratings and display them.
ii) The count of each Credit Rating should be displayed in the cell to the right of it the rating.
iii) The average value of the coupons against each credit rating should be displayed in the cell to the right.
iv) The population standard deviation of the coupons of that credit rating should be displayed in the cell to the right.
I am attaching the sample data file for reference as well.