Weighted average sort by name

hfler

Board Regular
Joined
Jun 10, 2008
Messages
95
Hello--

I am trying to calculate the weighted average of a column that is organized by name. I already successfully calculated the weighted average of a column organized by number using this formula:

=SUMPRODUCT(--(Master!H4:H10002=1),Master!I4:I10002,Master!F4:F10002)/C4

Where column H contains the category by which I want to sort, column I contains the values for which I want to find the weighted average, column F contains the values I am finding the weight of, and column C is a total of all the values I am finding the weight of.

Hopefully that makes sense. Now, instead of sorting by the number "1", I want to sort by name, for instance, "northeast." Any suggestions?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

iliace

Well-known Member
Joined
Jan 15, 2008
Messages
3,546
Office Version
  1. 365
  2. 2016
  3. 2010
Platform
  1. Windows
So like this?

=SUMPRODUCT(--(Master!H4:H10002="northeast"), Master!I4:I10002, Master!F4:F10002)/C4
 
Upvote 0

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
20,921
Office Version
  1. 365
Platform
  1. Windows
Does C4 contain a formula? If so, can you post the formula? Assuming that Column G contains the name, such as 'northeast', maybe...

=SUMPRODUCT(--(Master!G4:G10002="northeast"),Master!I4:I10002,Master!F4:F10002)/SUMPRODUCT(--(Master!G4:G10002="northeast"),Master!F4:F10002)

Hope this helps!
 
Upvote 0

iliace

Well-known Member
Joined
Jan 15, 2008
Messages
3,546
Office Version
  1. 365
  2. 2016
  3. 2010
Platform
  1. Windows
It might not be exactly "northeast"; the text needs to be exact.
 
Upvote 0

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
20,921
Office Version
  1. 365
Platform
  1. Windows
Can you post a small sample of the data?
 
Upvote 0

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
Would you answer the question Domenic posed regarding C4: What formula if any do you have in C4?

What is the range which must meet the condition of "northeast"?
 
Upvote 0

hfler

Board Regular
Joined
Jun 10, 2008
Messages
95
Column contained the sum of all of the values of column F. Column F is the column by which I am weighting. Maybe there is a more efficient way to do that...

The range for "Northeast" should be between H1:H100000.

I'll post some of the data, too...
 
Upvote 0

Forum statistics

Threads
1,191,697
Messages
5,988,164
Members
440,131
Latest member
EricMoz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top