How to dynamically order unique dates chronologically found in two tables?

Sevigny86

New Member
Joined
Apr 18, 2018
Messages
15
Good afternoon board!


I am constructing a portfolio and I want to auto generate my positions. My goal is to determine my portfolio position at every trade date.

Context: I have two tables in a "Transaction History" worksheet, one with all the Trades and the other with all Dividends Received. In a separate "Portfolio" worksheet, I want to arrange every date where a transaction occurred, whether it was a trade or a dividend payment. The rest of that table auto-populates the change in cash and stock position based on the date.
The issue I'm having is to create a formula that will search both tables; Trades and Dividends, which are vertical, and list out each unique date horizontally in my Portfolio page.


I found this formula that can search and list dates found in column A chronologically, but I have been unable to adapt it to my needs!


=INDEX($A$2:$A$15,MATCH(ROWS($A$2:A2),COUNTIF($A$2:$A$15,"<="&$A$2:$A$15),0))

Here is some sample data:

Portfolio Worksheet:
Lisgb7u.png


Trade & Dividend History
YPvI3XE.png



And here is a bonus Q if someone is able to answer:
I want to populate the Dividend History table, chronologically, with all dividends paid which are in a separate table per stock. Here is a sample of what two of the 14 identical tables look like:


8XP1X3G.png


Thanks in advance!
 
Last edited:

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Finally figured it out.

I used Excel Tables to create Queries, and then combined & appended them. This allows to take any number of tables and combine into one.

For my main question, I simply deleted the other columns not needed, leaving only Dates, which I ordered from A-Z using the filter, and then just pivoted horizontally. Only needed to Load to a selected cell and voila.

For my bonus question, it was solved while completing the other task, its a simpler version, just without pivoting etc.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top