View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
censura censura is offline
external usenet poster
 
Posts: 4
Default How do I calculate a value based on dates?

Dave hope you can help, i have trades i make (forex) listed by day and may
make 2-3 trades per day on different currencies ie

14-mar -20 Gbp
14-Mar +43 CHF
14-Mar +12 Eur

I have a column which summerises the daily profit/loss on each day, but i
have to manually change the field range on my sum product function each time
i add new trades to the spread sheet is there anyway to automatically update
the spreadsheet as new entriea are made. Also i would like the equity curve
graph i have based on the daily profit/loss to be updated automatically
hope you can help

thank you
--
thank you
censura


"Dave O" wrote:

Hi, John-
I arrived at a solution for this by mocking up some data:
~Column headers "Date" "Type" and "Amount" in A3:C3
~Date entries from Feb to May in A4:A15
~Line identifiers "Labor" "Travel" and "Other" in the Type column,
from B4:B15
~Dollar amounts in C4:C15
A summary section:
~A "Month to Date" column header in A17
~The date 2/1/2005 entered in A18:A20 formatted to display as Feb 2005
~Line identifiers "Labor" "Travel" and "Other" in the Type column,
from B8:B20

I entered this formula in C18:
=SUMPRODUCT(--(MONTH($A$4:$A$15)=MONTH(A18)),--($B$4:$B$15=B18),$C$4:$C$15)

The SUMPRODUCT() formula used in this context allows you to specify
parameters used to sum a column of data. The "--" in the formula is a
double unary operator that causes Excel to evaluate a True or False
value as a 1 or 0. For a given line, if the Month parameter is True
and the Line Identifier is True, Excel multiplies 1 x 1 x the value in
column C, and augments the sum. If one of the parameters is False, a 0
multiplier is used: since any number times 0 is 0, the sum is not
augmented.