hello,
got a goofy one here. I need to include a count of items in a subtotal, that is listed on each line of the subtotal, including the rollup itself, without factoring the summary data:
[TABLE="width: 736"]
<tbody>[TR]
[TD]Tranaction[/TD]
[TD]account[/TD]
[TD]security[/TD]
[TD]price[/TD]
[TD]broker[/TD]
[TD]shares[/TD]
[TD]BlockNumber[/TD]
[TD]need to return value in[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Buy[/TD]
[TD]BLOCK[/TD]
[TD]aapl[/TD]
[TD="align: right"]101.01[/TD]
[TD]abcd[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]0[/TD]
[TD] g5 (3)[/TD]
[TD]summary row[/TD]
[/TR]
[TR]
[TD]Buy[/TD]
[TD]a1[/TD]
[TD]aapl[/TD]
[TD="align: right"]101.01[/TD]
[TD]abcd[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]1[/TD]
[TD]g5 (3)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Buy[/TD]
[TD]a2[/TD]
[TD]aapl[/TD]
[TD="align: right"]101.01[/TD]
[TD]abcd[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]2[/TD]
[TD] g5 (3)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Buy[/TD]
[TD]a3[/TD]
[TD]aapl[/TD]
[TD="align: right"]101.01[/TD]
[TD]abcd[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]3[/TD]
[TD] g5 (3)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]sell[/TD]
[TD]BLOCK[/TD]
[TD]xom[/TD]
[TD="align: right"]50.05[/TD]
[TD]poiu[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]0[/TD]
[TD]g10 (4)[/TD]
[TD]summary row[/TD]
[/TR]
[TR]
[TD]sell[/TD]
[TD]a1[/TD]
[TD]xom[/TD]
[TD="align: right"]50.05[/TD]
[TD]poiu[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]1[/TD]
[TD] g10 (4)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]sell[/TD]
[TD]a2[/TD]
[TD]xom[/TD]
[TD="align: right"]50.05[/TD]
[TD]poiu[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]2[/TD]
[TD] g10 (4)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]sell[/TD]
[TD]a3[/TD]
[TD]xom[/TD]
[TD="align: right"]50.05[/TD]
[TD]poiu[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]3[/TD]
[TD] g10 (4)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]sell[/TD]
[TD]a4[/TD]
[TD]xom[/TD]
[TD="align: right"]50.05[/TD]
[TD]poiu[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]4[/TD]
[TD] g10 (4)[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
In the above, i need to return the largest block number for each trade in the last colum, so 3 for rows 2-5, and 4 for rows 6-10
in a real scenario, these blocks could be 20+ rows, and there could be multiple blocks for the same security, just with different brokers or at different prices. No blocks will ever be guaranteed to be uniform in size.
i have messed around with a bunch of max/vlookup hybrids, but its everything has just returned the highest value in the column, regardless of the trade details. ultimately, this will need to be processed in a vba macro
Is this possible to do? i feel like it should be, but its driving me crazy. any help would be greatly appreciated.
Thanks!
Mike
got a goofy one here. I need to include a count of items in a subtotal, that is listed on each line of the subtotal, including the rollup itself, without factoring the summary data:
[TABLE="width: 736"]
<tbody>[TR]
[TD]Tranaction[/TD]
[TD]account[/TD]
[TD]security[/TD]
[TD]price[/TD]
[TD]broker[/TD]
[TD]shares[/TD]
[TD]BlockNumber[/TD]
[TD]need to return value in[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Buy[/TD]
[TD]BLOCK[/TD]
[TD]aapl[/TD]
[TD="align: right"]101.01[/TD]
[TD]abcd[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]0[/TD]
[TD] g5 (3)[/TD]
[TD]summary row[/TD]
[/TR]
[TR]
[TD]Buy[/TD]
[TD]a1[/TD]
[TD]aapl[/TD]
[TD="align: right"]101.01[/TD]
[TD]abcd[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]1[/TD]
[TD]g5 (3)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Buy[/TD]
[TD]a2[/TD]
[TD]aapl[/TD]
[TD="align: right"]101.01[/TD]
[TD]abcd[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]2[/TD]
[TD] g5 (3)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Buy[/TD]
[TD]a3[/TD]
[TD]aapl[/TD]
[TD="align: right"]101.01[/TD]
[TD]abcd[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]3[/TD]
[TD] g5 (3)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]sell[/TD]
[TD]BLOCK[/TD]
[TD]xom[/TD]
[TD="align: right"]50.05[/TD]
[TD]poiu[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]0[/TD]
[TD]g10 (4)[/TD]
[TD]summary row[/TD]
[/TR]
[TR]
[TD]sell[/TD]
[TD]a1[/TD]
[TD]xom[/TD]
[TD="align: right"]50.05[/TD]
[TD]poiu[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]1[/TD]
[TD] g10 (4)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]sell[/TD]
[TD]a2[/TD]
[TD]xom[/TD]
[TD="align: right"]50.05[/TD]
[TD]poiu[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]2[/TD]
[TD] g10 (4)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]sell[/TD]
[TD]a3[/TD]
[TD]xom[/TD]
[TD="align: right"]50.05[/TD]
[TD]poiu[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]3[/TD]
[TD] g10 (4)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]sell[/TD]
[TD]a4[/TD]
[TD]xom[/TD]
[TD="align: right"]50.05[/TD]
[TD]poiu[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]4[/TD]
[TD] g10 (4)[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
In the above, i need to return the largest block number for each trade in the last colum, so 3 for rows 2-5, and 4 for rows 6-10
in a real scenario, these blocks could be 20+ rows, and there could be multiple blocks for the same security, just with different brokers or at different prices. No blocks will ever be guaranteed to be uniform in size.
i have messed around with a bunch of max/vlookup hybrids, but its everything has just returned the highest value in the column, regardless of the trade details. ultimately, this will need to be processed in a vba macro
Is this possible to do? i feel like it should be, but its driving me crazy. any help would be greatly appreciated.
Thanks!
Mike