IF Mutiple Same Values in Same Column Formula

rowbro

Board Regular
Joined
Dec 16, 2010
Messages
50
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

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.
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.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,874
Messages
6,122,036
Members
449,062
Latest member
mike575

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
Back
Top