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 does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
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,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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