# Weighted Average with conditions

#### MRExcel1

##### New Member
Hi Everyone ,
I'm trying to figure out the forumla to calculate the weighted average if Contract# from table 1 = Contract # from table 2 & Invoice Date from Table 1 = Date from Table 2.

anyone can help??

 Table1 Cotract# Invoice Date Volume Price Con01 20-Mar-13 1000 1.5 Con01 20-Mar-13 1000 1.5 Con01 20-Mar-13 1000 1.5 Contract02 23-Mar-13 500 1 Contract02 23-Mar-13 600 2 Contract02 19-Mar-13 700 3 Contract02 23-Mar-13 800 4 Contract02 23-Mar-13 900 5 Cot03 01-Mar-13 1000 1.3 Cot03 01-Mar-13 1000 1.3 Cot03 01-Mar-13 1000 1.3

<tbody>
</tbody>

 Table 2 Weighted Average Price when contract # and Date matche Table 1 Cotract# Date Contract02 23/03/2013 ???? Expected Answer 3.36

<tbody>
</tbody>

### Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Hi

Try in I2:

=SUMPRODUCT(--(B2:B12=H2),C2:C12,D2:D12)/SUMIF(B2:B12,H2,C2:C12)

Thank you very much , that's solves it

Hi

Try in I2:

=SUMPRODUCT(--(B2:B12=H2),C2:C12,D2:D12)/SUMIF(B2:B12,H2,C2:C12)

ABCDEFGHIJ
1Cotract#Invoice DateVolumePrice Cotract#Date
2Con012013-03-2010001.5 Contract022013-03-233.36
3Con012013-03-2010001.5
4Con012013-03-2010001.5
5Contract022013-03-235001
6Contract022013-03-236002
7Contract022013-03-197003
8Contract022013-03-238004
9Contract022013-03-239005
10Cot032013-03-0110001.3
11Cot032013-03-0110001.3
12Cot032013-03-0110001.3
13
14
[Book1]Sheet2

<tbody>
</tbody>

You're welcome. Thanks for the feedback.

Replies
2
Views
91
Replies
7
Views
89
Replies
7
Views
121
Replies
20
Views
244
Replies
1
Views
539

1,196,042
Messages
6,013,049
Members
441,746
Latest member
ArtemisAlex

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

### Which adblocker are you using?

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

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