# Harmonic Mean

Basic Exercise

## Statement

Make an application to calculate the harmonic mean of selected values. Note: $MH = \frac{N}{\frac{1}{x_{1}}+\frac{1}{x_{2}}+\frac{1}{x_{3}}+...+\frac{1}{x_{n}}}$

## Suggested Concepts:

• Dim - Declares a variable.
• For Each - Repeats a group of statements for each element in a collection.
• Range - Allows VBA to interact with the worksheet and its cells.
• Function - Function will return a value.

Remember that in most cases there is more than one way to solve the exercise.

Hint: Create a variable to add to the denominator the inverse $(\frac{1}{x})$ of the value in a cell. Use the counting of $n$ as the numerator.