bowmanbowman
New Member
- Joined
- Nov 6, 2018
- Messages
- 1
[FONT="]I need help creating a few VBA functions in Excel:[/FONT]
[FONT="]
[/FONT]
[FONT="]First I need to write a function (myCountIfs) that works similar to Excel's in built COUNTIFS function. It returns an integer.[/FONT]
[/FONT]
[FONT="]Then I need to write a function (myAverageIf) that works similar to Excel's in-built AVERAGEIF function works. The function should take in three arguments. It returns a double[/FONT]
[FONT="]
[/FONT]
[FONT="]First I need to write a function (myCountIfs) that works similar to Excel's in built COUNTIFS function. It returns an integer.[/FONT]
- The first is a range that will be used in the calculation (i.e., average)
- The first is the 1st range that will be used for the criteria
- The second is the string value that the criteria cell values must be
- The third is the 2nd range that will be used for the criteria
- The fourth is a string value that the criteria cell values must be.
- For instance, if the user enters myCountIfs(B2:B10,"student", D2:D10, "boat"), the result should return 2.
[/FONT]
[FONT="]Then I need to write a function (myAverageIf) that works similar to Excel's in-built AVERAGEIF function works. The function should take in three arguments. It returns a double[/FONT]
- The first is a range that will be used in the calculation (i.e., average)
- The second is the range that will be used for the criteria
- The third is a string value that the criteria cell values must be
- For instance, if the user enters myAverageIf(C2:C10, D2:D10, "boat") the resultshould return 1.395.