# Weighted average sort by name

#### hfler

##### Board Regular
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
So like this?

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

#### hfler

##### Board Regular
that actually did not work for some reason

#### Domenic

##### MrExcel MVP
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!

#### iliace

##### Well-known Member
It might not be exactly "northeast"; the text needs to be exact.

#### hfler

##### Board Regular
That didn't work, thanks though.

#### Domenic

##### MrExcel MVP
Can you post a small sample of the data?

##### MrExcel MVP
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"?

#### hfler

##### Board Regular
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...

Replies
5
Views
166
Replies
11
Views
124
Replies
12
Views
198
Replies
3
Views
189
Replies
1
Views
433

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?

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