PDA

View Full Version : Need help with homework problem



spamcensor
04-20-2015, 11:06 AM
I know the solution to this is simple, but I can't figure this out for the life of me. Any help would be greatly appreciated!

Create a function that takes as input a range of cells, averages those cells, and returns the square of that average. Call the function AvgSquared(range). If it can't find an average it should return the string "no numeric values".

Paul_Hossler
04-20-2015, 11:51 AM
What do you have so far?

1. Defining a function is right out of Help




Function AvgSquared (R as Range) as Variant



End Function




2.

For Each C in R.Cells ..... Next


will loop through the cells


3. You know the definition of 'Average' = Sum of the cells / count of the cells


4. Add error checking as required (If IsNumeric(c) ......


5. Stir and bake at 350 degrees for 30 minutes


Take a shot and come back if you get stuck