Hi,

I am doing some trades on European gas hubs. When I have done my work, I can extract a list of all the trades I have done. It will look like the list I have attached. Book1.xlsx

There are 3 hubs (called Product): TTF, NCG and Gaspool. The Period can be WD or DA (Within day or Day ahead), so there is a total of 6 combinations: TTF WD, TTF DA, NCG WD, NCG DA, Gaspool WD, Gaspool DA. The Quantity is an hourly value, so the total sold Quantity is 24 times as high.
My profit is held up against the closing price WD and DA on each hub, which are 6 distinct values, I will manually insert.

So I would like to know how I can check what profits I have made...

Something like this:
If Agressor Company is My Company and Agressor Action is Bought I have bought the gas. Then the tool must calculate how much I have paid for it (Price), subtract the Closing Price, multiply it by 24 and multiply it with the Quantity. Negative value is a profit, positive value is a loss.
If Agressor Company is My Company and Agressor Action is Sold I have sold the gas. Then the tool must calculate how much I have sold it for (Price), subtract the Closing Price, multiply it by 24 and multiply it with the Quantity. Positive value is a profit, negative value is a loss.
If Agressor Company is not My Company and Agressor Action is Bought I have sold the gas. Then the tool must calculate how much I have sold it for (Price), subtract the Closing Price, multiply it by 24 and multiply it with the Quantity. Positive value is a profit, negative value is a loss.
If Agressor Company is not My Company and Agressor Action is Sold I have bought the gas. Then the tool must calculate how much I have bought it for (Price), subtract the Closing Price, multiply it by 24 and multiply it with the Quantity. Negative value is a profit, positive value is a loss.

I will really appreciate it, if one of you can help me out here.

Thank you very much in advance.

Best regards

Jacob Boldsen