Hi all,
I'd like to add a new condition to the formula below, which is supposed to calculate the average trade price in a few deals.

In English, this means that, if Selected Row's Date (B15) is less than or equal to today's date (B4), then do the following calculation. It's calculation trading results given (i) the security (cells HM$13), and (ii) the Settlement Date (cells $B15). I need to add the condition that Trade Date is different than the Settlement Date (both dates are in two different columns in another sheet, where each line displays one particular trade)

=IF($B15<=$B$4;IF(BG15<>0;SUM(IF((SettlDate_Blotter=$B15)*(Securities_Blotter=HM$13);Contracts_Blotter*TradePrice_Blotter))/BG15;SUM(IF((SettlDate_Blotter=$B15)*(Securities_Blotter=HM$13);Contracts_Blotter*TradePrice_Blotter)));0)

When Trade Date (shown as a column in sheet 2) = Settl. Date (shown as a different column in sheet 2), the calculation is exactly the one shown above. But when Trade Date is different than Settl. Date, the result should be brought to present value.


Any ideas??

Thanks in advance,
Bruno