Raelantorm
New Member
- Joined
- Oct 19, 2009
- Messages
- 2
Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com
ffice
ffice" /><o
></o
>
<o
></o
>
I have written a formula to calculate an average price, plus or minus commission, if the values in each column conform to the following criteria: <o
></o
>
If column B = AH, C = Buy and F = 3 MONTH, add 1 to the averaged price.<o
></o
>
If column B = AH, C = Sell and F = 3 MONTH, minus 1 from the averaged price.<o
></o
>
<o
></o
>
=IF(F:F="3 MONTH",G:G*D:D) <o
></o
>
AH Ave Buy =SUMPRODUCT(($B2:$B$9999="AH")*($C2:$C$9999="Buy")*($I$2:$I$9999)*($F2:$F9999="3 MONTH"))/SUMPRODUCT(($B2:$B$9999="AH")*($C2:$C$9999="Buy")*($D$2:$D$9999)*($F2:$F9999="3 MONTH"))+1<o
></o
>
AH Ave Sell =SUMPRODUCT(($B2:$B$9999="AH")*($C2:$C$9999="Sell")*($I$2:$I$9999)*($F2:$F9999="3 MONTH"))/SUMPRODUCT(($B2:$B$9999="AH")*($C2:$C$9999="Sell")*($D$2:$D$9999)*($F2:$F9999="3 MONTH"))-1<o
></o
>
<o
></o
>
This only works if I paste the formula directly into the workbook, but I would like this info to be stored in a Macro. The problem is that because I have pasted it, the Macro only shows "ActiveSheet.Paste". This is why I think I need to convert the formula to vba.
<o
></o
>
Any help here would be most welcome, as I have been pulling my hair out trying to get it to work! <o
></o
>
<o
></o
>
Btw, I am very new to excel formulas/macros and may be missing something obvious. Apologies if I seem like a noob!<o
></o
>
<o
></o
>
Thanks,<o
></o
>
Rae<o
></o
>




<o


I have written a formula to calculate an average price, plus or minus commission, if the values in each column conform to the following criteria: <o


If column B = AH, C = Buy and F = 3 MONTH, add 1 to the averaged price.<o


If column B = AH, C = Sell and F = 3 MONTH, minus 1 from the averaged price.<o


<o


=IF(F:F="3 MONTH",G:G*D:D) <o


AH Ave Buy =SUMPRODUCT(($B2:$B$9999="AH")*($C2:$C$9999="Buy")*($I$2:$I$9999)*($F2:$F9999="3 MONTH"))/SUMPRODUCT(($B2:$B$9999="AH")*($C2:$C$9999="Buy")*($D$2:$D$9999)*($F2:$F9999="3 MONTH"))+1<o


AH Ave Sell =SUMPRODUCT(($B2:$B$9999="AH")*($C2:$C$9999="Sell")*($I$2:$I$9999)*($F2:$F9999="3 MONTH"))/SUMPRODUCT(($B2:$B$9999="AH")*($C2:$C$9999="Sell")*($D$2:$D$9999)*($F2:$F9999="3 MONTH"))-1<o


<o


This only works if I paste the formula directly into the workbook, but I would like this info to be stored in a Macro. The problem is that because I have pasted it, the Macro only shows "ActiveSheet.Paste". This is why I think I need to convert the formula to vba.
<o


Any help here would be most welcome, as I have been pulling my hair out trying to get it to work! <o


<o


Btw, I am very new to excel formulas/macros and may be missing something obvious. Apologies if I seem like a noob!<o


<o


Thanks,<o


Rae<o

