H

#### Helixal

1 date nane1 buy 34 99

2 date name1 sell 24 56

3 date name2 buy 56 99

4 date name3 buy 36 103

5 date name 3 buy 28 34

6 date name3 sell 12 470

I want to create an excell spread sheet of 8 columns and unlimited rows.

I'd like column h to be the sum of the numbers in column f for each name.

where buy would be a positive number and sell would be a negative number.

In this example the number 10 (34-24) would go in cloumn f row 2. These are

the sum of buys and sells for name1. Name2 would be 56 in row 3 and name3

would be 76 in row 6. Any row could contain words other that "buy" or "sell"

in which case that entire row should be ignored. If that happens to be the

last row of any given name then the result should be placed on that row.

Similarly i'd like to sum column g and place the result in column i. In

this case however the word buy has negative meaning and the word sell has a

positive meaning. So row 2 i would contain -43. 3i would contain -99 and

6i would contain 333.

Think of these as purchases and sales of securities. Name1 could stand for

the purchase of 34 shares of AT&T for $99 and the sale of 24 shares at $56.

The result would be 10 shares and $-43 (LOSS)

The trick is to sum the numbers till the name changes. There are no row

delimiters between names.

Help would be appreciated.