2 Replies Latest reply on Oct 27, 2016 8:23 AM by rajul Parekh

# Weighted Average

Hi all - Struggling to understand how to write a calculation for a weighted average. Attached the workbook but basically need a vertical line to show the average number of pitches made. Should be straightforward but every time I write the following equation I get an error. I think it has to do with the count of last names (which is the count of people per number of pitches).

Thanks!

• ###### 1. Re: Weighted Average

Hi Rajul,

Just looking at the formula, looks like the syntax is a bit off. Instead of:

SUM([# Pitches] * COUNTD([What is your last name?]))/COUNTD([What is your last name?])

This should work:

(SUM([# Pitches]) * COUNTD([What is your last name?]))/COUNTD([What is your last name?])

SUM and COUNTD are functions that aggregate data (the dimension or measure you put within parenthesis after the function name). On your formula, the SUM function was missing a parenthesis.

Hope this helps!

• ###### 2. Re: Weighted Average

Hi Santiago - thanks so much for your help!

Tried what you said but I'm not sure it's calculating correctly. The averages at the top of each bar don't seem correct... Also, I just need one average across ALL the columns. For example, I would guesstimate that the average is somewhere between 10-15 pitches.

Does that make sense?