D
Dallman Ross
The following has me perplexed. I would have thought SUMIF
would be what I want, but I can't get it to work.
I have a worksheet with some information about stock transactions.
Col. B is the Quantity (shares purchased). Col. C is Date Bought.
Col. F is Date Sold. Col. M is Days Held, but we probably don't
need that for my question, and anyway, that's just F minus B.
I want to know how many total shares I owned at the time of
each new purchase.
Here's a sample. It's sorted by Column F, then Column C:
B C F M
Quantity Bought Sold Days Held
row -------- ------ ------ ---------
4 100 19-Feb-02 9-Jan-03 324
5 200 19-Feb-02 9-Jan-03 324
6 100 11-Mar-02 9-Jan-03 304
7 100 11-Mar-02 13-Jan-03 308
8 200 12-Mar-02 13-Jan-03 307
9 300 12-Mar-02 5-Feb-03 330
. . . .
47 200 31-Jan-03 15-May-03 104
48 300 25-Feb-03 15-May-03 79
Let's suppose the data is expressed between rows 4 and 48 inclusive.
I tried something like this:
=SUMIF(F$4:F$48,"<=C4",B$4:B$48)
And I tried dragging that down. The criteria (in quotes) is what
doesn't work, and it also doesn't increment when I drag.
What I want is to know is the max shares owned during each row's
day-spread. So at any time between 19 Feb 02 and 9 Jan 03 (inclusive) I
owned 100 + 200 + 100 + 100 + 200 + 300 shares, and that total could in,
say, cell Z4. The Z5's formula would happen calculate the same spread,
because the dates are identical. Z47 would show that I owned, max,
500 shares during the period from 31 Jan 03 through 15 May 03.
Hmm, the average shares owned during the time period would be cool
too, but let's get the first problem solved first. (The we
can work on graphing it, which I'm also having some trouble with,
but more on that later.)
Thanks for any help.
would be what I want, but I can't get it to work.
I have a worksheet with some information about stock transactions.
Col. B is the Quantity (shares purchased). Col. C is Date Bought.
Col. F is Date Sold. Col. M is Days Held, but we probably don't
need that for my question, and anyway, that's just F minus B.
I want to know how many total shares I owned at the time of
each new purchase.
Here's a sample. It's sorted by Column F, then Column C:
B C F M
Quantity Bought Sold Days Held
row -------- ------ ------ ---------
4 100 19-Feb-02 9-Jan-03 324
5 200 19-Feb-02 9-Jan-03 324
6 100 11-Mar-02 9-Jan-03 304
7 100 11-Mar-02 13-Jan-03 308
8 200 12-Mar-02 13-Jan-03 307
9 300 12-Mar-02 5-Feb-03 330
. . . .
47 200 31-Jan-03 15-May-03 104
48 300 25-Feb-03 15-May-03 79
Let's suppose the data is expressed between rows 4 and 48 inclusive.
I tried something like this:
=SUMIF(F$4:F$48,"<=C4",B$4:B$48)
And I tried dragging that down. The criteria (in quotes) is what
doesn't work, and it also doesn't increment when I drag.
What I want is to know is the max shares owned during each row's
day-spread. So at any time between 19 Feb 02 and 9 Jan 03 (inclusive) I
owned 100 + 200 + 100 + 100 + 200 + 300 shares, and that total could in,
say, cell Z4. The Z5's formula would happen calculate the same spread,
because the dates are identical. Z47 would show that I owned, max,
500 shares during the period from 31 Jan 03 through 15 May 03.
Hmm, the average shares owned during the time period would be cool
too, but let's get the first problem solved first. (The we
can work on graphing it, which I'm also having some trouble with,
but more on that later.)
Thanks for any help.