# IF Mutiple Same Values in Same Column Formula

#### rowbro

##### Board Regular
Hi folks - I am trying to figure out the most simple formula to do the following:

IF the value of two items in the same column have the same value (stock name) AS WELL AS the same date AND the same additional value (buy or sell), then, calculate a weighted average price using the following sum: sumproduct(A1*B1+A2*B2)/sum(B1+B2).

Thanks.

### Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I would use an "IF(SUM(IF" array formula (or an "IF(SUMPRODUCT" formula) to calculate whether or not multiple matches exist, and then perform a weighted average calculation if that condition was present.

Chris.

Thanks Chris - the issue I have, however, is that I want the "IF" to look for repeated values, not to have to say "IF(A1="Blah",,)". The reason for this is that there are about 50 possible values that could be repeated. Any work around for this?

Thanks again.

I'd really have to have a better idea of the way the sheet is structured and what you're looking for specifically.

What I'm suggesting is more of a "IF(SUM(IF(\$A\$1:\$A\$100="Blah",,)".

Chris.

Replies
18
Views
409
Replies
4
Views
128
Replies
3
Views
80
Replies
1
Views
178
Replies
9
Views
454

1,221,423
Messages
6,159,821
Members
451,591
Latest member
j0eyjedi

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