Im_Offset
Member
Hello everyone,
I am trying to figure out a formulaic method to solve my "problem." (i.e. I don't want to use VBA just yet)
Please reference the attached spreadsheet. On the tab labeled "Master" is a table of stock market trades for this year. Columns A - H are all manually entered, and Column I is manually entered if a formula in Column J says a value is needed. The important column to highlight is Column C. This column shows if a trade is an opening trade or a closing trade.
I am tasked with matching the closing trades with their corresponding opening trade in a new table. I have created this table manually in the tab labeled "Manual Open Close". You can see in this table that every "closing" trade has a corresponding "opening" trade, but an "opening" trade does not have to have a "closing" trade (this is because the trade may still be open, or that the trade expiration date arrived and it was automatically closed without needed a closing trade).
I want to find a way to create this new table using formulas, and I am using the tab labeled "Formula Open Close" to do that. Creating the list of "opening" trades was fairly straight forward using an array formula in Column A to list the trade number of each opening trade. However, is it possible to use a formula in Column L to search for closing trades on the list in the "Master" tab, and then list the trade number of each closing trade to the appropriate opening trade?
To be a matched "pair" (i.e. for the closing trade to be listed with the correct opening trade), the following conditions must all apply:
1) the sum of the contracts in the opening trade and the closing trade must = 0
2) the Call/ Put information (columns E and P) must be the same
3) the Strike levels (columns F and Q) must be the same
4) the Exp Date (columns G and R) must be the same
You will know if the closing trade is properly matched, because Column T will show "Error" if there is a problem with the information in the closing trade section.
So...is there a super formula that can do this?
Thanks!
Clearly....I am Offset
I am trying to figure out a formulaic method to solve my "problem." (i.e. I don't want to use VBA just yet)
Please reference the attached spreadsheet. On the tab labeled "Master" is a table of stock market trades for this year. Columns A - H are all manually entered, and Column I is manually entered if a formula in Column J says a value is needed. The important column to highlight is Column C. This column shows if a trade is an opening trade or a closing trade.
I am tasked with matching the closing trades with their corresponding opening trade in a new table. I have created this table manually in the tab labeled "Manual Open Close". You can see in this table that every "closing" trade has a corresponding "opening" trade, but an "opening" trade does not have to have a "closing" trade (this is because the trade may still be open, or that the trade expiration date arrived and it was automatically closed without needed a closing trade).
I want to find a way to create this new table using formulas, and I am using the tab labeled "Formula Open Close" to do that. Creating the list of "opening" trades was fairly straight forward using an array formula in Column A to list the trade number of each opening trade. However, is it possible to use a formula in Column L to search for closing trades on the list in the "Master" tab, and then list the trade number of each closing trade to the appropriate opening trade?
To be a matched "pair" (i.e. for the closing trade to be listed with the correct opening trade), the following conditions must all apply:
1) the sum of the contracts in the opening trade and the closing trade must = 0
2) the Call/ Put information (columns E and P) must be the same
3) the Strike levels (columns F and Q) must be the same
4) the Exp Date (columns G and R) must be the same
You will know if the closing trade is properly matched, because Column T will show "Error" if there is a problem with the information in the closing trade section.
So...is there a super formula that can do this?
Thanks!
Clearly....I am Offset
