+ Reply to Thread
Results 1 to 3 of 3

How to dynamically transpose array of data sorted by timestamp & group them horizontally?

  1. #1
    Registered User
    Join Date
    08-30-2019
    Location
    California
    MS-Off Ver
    2019
    Posts
    2

    Question How to dynamically transpose array of data sorted by timestamp & group them horizontally?

    Please help me with my excel project. I have a stock trading spreadsheet with a database I export from my trading platform sorted vertically by execution date (regardless of whether Its a buy or a sell). I am trying to think of a way to dynamically transpose my database horizontally, grouped by their corresponding ticker symbol and sorted out from left to right by date (see link for desired transposed data image below. I also attached a sample data spreadsheet).

    Raw data pulled from platform:
    link: i.imgur.com/6Gt94gm.jpg

    *ignore the following header: Order Type, Pos effect and Spread.

    Desired dynamically transposed data:
    link: i.imgur.com/Bs0G5VF.jpg

    *"Filled" header contains the entry prices and "Cover" contains the exit prices. "Shares" are the quantity.


    Spreadsheet structure:
    - Each trading cycle has their own single row sorted by execution sequence.
    - buying and selling trades should be logged in separate tables.
    - can only have up to a total of 3 entries and 3 exits within a single trade
    - can both have long (buying stock as an entry trade and selling to close) and shorting (selling stock as entry trade and buying to close).
    *short trades should have negative shares, as shown in the image below, for both entries and exits (for later calculations convenience).


    Challenges:
    - after buying a stock, I might increment or decrement my shares of stock later on after buying and/or selling different stocks, or after buying or selling the stock thereof.
    - after selling all my shares from a single stock, I might open a new position and buy the same stock multiple times immediately after or later on after many different trades from different stocks have been executed.
    - buying and selling stock(s) may occur within the same day.


    I am working with MS Office 2019 but would prefer a solution working with earlier ms version (no earlier than 2016), and avoiding vba as much as possible.

    I would deeply appreciate it if anyone would be of any help to my project. Thank you in advance.
    Attached Files Attached Files
    Last edited by marklcrns; 08-30-2019 at 11:28 AM. Reason: Including a sample workbook

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,443

    Re: How to dynamically transpose array of data sorted by timestamp & group them horizontal

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    08-30-2019
    Location
    California
    MS-Off Ver
    2019
    Posts
    2

    Re: How to dynamically transpose array of data sorted by timestamp & group them horizontal

    Will do thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Expand Defined Name Range Horizontally to Dynamically Change Chart with new data
    By machl22 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-20-2017, 12:14 PM
  2. [SOLVED] Group Data Labels Horizontally
    By Darrellcoholic in forum Excel General
    Replies: 4
    Last Post: 09-16-2015, 05:35 AM
  3. Product sell with barcode reader using timestamp sorted per day
    By danfolt in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-12-2015, 04:13 PM
  4. Text in vertical row to be sorted horizontally in groups
    By JAucamp in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-21-2015, 10:38 AM
  5. [SOLVED] transpose and consolidate data horizontally to vertically
    By Excel_learner in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-04-2014, 03:50 PM
  6. [SOLVED] Macro to transpose vertical data horizontally from one sheet to another
    By Scott_88 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-09-2013, 06:27 AM
  7. Dynamically Transpose Data??
    By .James in forum Excel General
    Replies: 17
    Last Post: 07-14-2008, 10:48 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1