+ Reply to Thread
Results 1 to 15 of 15

Bond portfolio automation

  1. #1
    Registered User
    Join Date
    12-19-2023
    Location
    London
    MS-Off Ver
    Microsoft 365
    Posts
    9

    Bond portfolio automation

    Hi everyone, looking to build a way to update automatically a bond portfolio based on the transactions (similar to a stock inventory management).
    One of the challenges I see is to implement the cost basis methodology (instead of an average price, which is good for now).

    Attaching sample for illustration.

    Thanks!

    Bondportfolio_automated.xlsx

  2. #2
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,895

    Re: Bond portfolio automation

    I'm not exactly sure of what you're looking for. Can you fill in the EXPECTED results in the spreadsheet?

  3. #3
    Registered User
    Join Date
    12-19-2023
    Location
    London
    MS-Off Ver
    Microsoft 365
    Posts
    9

    Re: Bond portfolio automation

    Bondportfolio_automated2.xlsx

    I have added an example here to show how transactions get booked into portfolio (condition should be sum of notional for a specific ISIN is <>0).

  4. #4
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,895

    Re: Bond portfolio automation

    Why isn't XS1910828182 showing up in Portfolio? Its notional is not = 0.
    And why is XS1953057491 showing twice? I thought maybe because of the "Side", but then the "Notionals" don't add up the same as you show.

  5. #5
    Registered User
    Join Date
    12-19-2023
    Location
    London
    MS-Off Ver
    Microsoft 365
    Posts
    9

    Re: Bond portfolio automation

    Bondportfolio_automated3.xlsx

    Apologies for the mistakes. Correct file uploaded.

    Thanks again

  6. #6
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,054

    Re: Bond portfolio automation

    Try this,
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Bond portfolio automation

    When sums need to be made per ISIN, it is not clear to me from which row the 2 dates and the price should be taken.
    After all, these can differ.

  8. #8
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Bond portfolio automation

    Second question is about Example 2.

    The total of ISIN XS1953057491 is -100, being the sum of 300, -300, 400, -300 and -200.
    However, the expected results and Windknife's formula show a total of 100.

    It appears that the last line is not included in the total. Why is that?

    This is the last line (which is excluded):
    03/Apr/20 Bond XS1953057491 EGYPT 8.7 2049 USD 01-Mar-2049 8.70 2 -200,000 05/Apr/20 94.00

  9. #9
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,895

    Re: Bond portfolio automation

    Here's another option:

    =LET(u,UNIQUE(D24:J27),
    x,XLOOKUP(INDEX(u,,2),E4:E15,C4:C15,,0),
    n,SUMIFS(K4:K15,E4:E15,INDEX(u,,2)),
    a,XLOOKUP(INDEX(u,,2),E4:E15,L4:L15,,0),
    b,XLOOKUP(INDEX(u,,2),E4:E15,M4:M15,,0),
    h,HSTACK(x,u,n,a,b),
    FILTER(h,INDEX(h,,9)<>0))

    This assumes that the transactions for each ISIN will be in date order, which your sample is and makes sense that this would be the case.

    Questions:
    You state that the date in Column C could be the oldest for that ISIN. My results for ISIN XS1953057491 show a date of 31-May-19, but your example and Windknife's both show a date of 09-Mar-20. Why that date if 31-May-19 is older?

    Also same question as Hans - I get a negative 100,000 for XS1953057491, but you and windknife both show positive 100,000. Why is that?

  10. #10
    Registered User
    Join Date
    12-19-2023
    Location
    London
    MS-Off Ver
    Microsoft 365
    Posts
    9

    Re: Bond portfolio automation

    Thank you windknife! Works spot on (and I am learning loads here).

  11. #11
    Registered User
    Join Date
    12-19-2023
    Location
    London
    MS-Off Ver
    Microsoft 365
    Posts
    9

    Re: Bond portfolio automation

    Thank you Gregb11 for your comment.
    You are absolutely right on the date selection. I should technically use the FIFO methodology (first trades to be booked in will be sold first) to get the accurate price on the remaining stock in inventory.

    - Re the date: by default, excel would pick the oldest date when there are multiple transactions on the same ISIN. I need to look further into windknife's formula. Please bear with me
    - Re XS1953057491: yes the amount should have been -100k (apologies one more time). That is the reason why I need to automate my spreadsheet.

  12. #12
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Bond portfolio automation

    - Re XS1953057491: yes the amount should have been -100k (apologies one more time).
    Why didn't you answer my question in Post #8?

    I had already come up with a formula that returns -100 but thought it wasn't good because of your expected results and the results of Windknife's formula.

    In addition, I also asked a question in Post #7, but have not yet seen an answer to that question.

    If you answer my question of Post #7 I'll come up with a solution.

  13. #13
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,054

    Re: Bond portfolio automation

    You are welcome.

  14. #14
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,895

    Re: Bond portfolio automation

    Thanks for rep and feedback!

  15. #15
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Bond portfolio automation

    I tried with Power Query and it was very easy!


    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The real action goes on #"Linhas Agrupadas1" and #"Linhas Agrupadas" the rest is adjustment.
    Attached Files Attached Files

+ 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. Performance Bond
    By BB Builder in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-01-2023, 04:54 PM
  2. [SOLVED] Bond on Bond Calculation
    By amlau0422 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-19-2022, 11:58 AM
  3. Bond formula Help
    By Concreteguy2001 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-24-2020, 05:59 PM
  4. Formula for bond price
    By Dracan in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-15-2014, 11:17 AM
  5. Need help with bond yields
    By jereln in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-09-2007, 04:09 AM
  6. bond convexity
    By Roger in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-23-2005, 05:35 PM
  7. date and bond calculations
    By saturnin02 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-29-2005, 01:06 PM

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