+ Reply to Thread
Results 1 to 13 of 13

Looking for the correct formula to retrieve the data

  1. #1
    Registered User
    Join Date
    11-10-2022
    Location
    Hong Kong
    MS-Off Ver
    Microsoft 365
    Posts
    7

    Looking for the correct formula to retrieve the data

    Here is the flow, but I don't know the correct formula.

    Picture1.png
    First, I have got a stock code, then a date referring to the announcement date of a circular.

    Picture2.png
    Then I have got many tabs in which I store the financial data in various stocks, the tab name is the stock code.

    Picture3.png
    I would like to get the cumulative return of T-1, T+0 (2021/11/4, referring to picture 1), T+1, total three days in the relevant tab.

    Picture4.png
    What formula should I put on the summary page and when I copy and paste the formula to other stocks it can give the correct answer?

    Edit: Please find the attached sample workbook.
    Test.xlsx

    Thank you.
    Last edited by ily4everrrrr; 11-10-2022 at 09:28 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,472

    Re: Looking for the correct formula to retrieve the data

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook. Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    11-10-2022
    Location
    Hong Kong
    MS-Off Ver
    Microsoft 365
    Posts
    7

    Re: Looking for the correct formula to retrieve the data

    Sorry for confusing. I attached the workbook in the thread.
    Last edited by AliGW; 11-10-2022 at 09:42 AM. Reason: Please DON'T quote unnecessarily!

  4. #4
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,042

    Re: Looking for the correct formula to retrieve the data

    Try this,=LET(x,"'"&B101&"'!S",y,MATCH(D101,'1636'!A:A,0),INDIRECT(x&y)+INDIRECT(x&y-1)+INDIRECT(x&y+1))

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

    Re: Looking for the correct formula to retrieve the data

    One way:

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

  6. #6
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,042

    Re: Looking for the correct formula to retrieve the data

    Thanks to Hans' formula, revised formula =LET(x,B101&"!S",y,MATCH(D101,'1636'!A:A,0),INDIRECT(x&y)+INDIRECT(x&y-1)+INDIRECT(x&y+1)).

  7. #7
    Registered User
    Join Date
    11-10-2022
    Location
    Hong Kong
    MS-Off Ver
    Microsoft 365
    Posts
    7

    Question Re: Looking for the correct formula to retrieve the data

    Thanks! It worked!

    Another question for the similar question (really simple, no sample workbook is required)
    Q: I still want to retrieve T-1, T+0, T+1 data based on the date, but only from one single tab (named "NASDAQ" as an example).
    How to amend the formula? Thanks!

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

    Re: Looking for the correct formula to retrieve the data

    Replace
    INDIRECT(B101&"!S2:S99999") by NASDAQ!S2:S9999 and
    INDIRECT(B101&"!A2:A99999") by NASDAQ!A2:A9999

  9. #9
    Registered User
    Join Date
    11-10-2022
    Location
    Hong Kong
    MS-Off Ver
    Microsoft 365
    Posts
    7

    Question Re: Looking for the correct formula to retrieve the data

    Test(CAR 252).xlsx

    This one is similar to cumulative abnormal return (CAR 3 days), but instead, it seeks to get the 252 days CAR (T0 - T+252, so actually need to retrieve 253 days data.)
    I found the steps different from CAR 3 days, as it takes compounding effects into consideration, so I can't just SUM(individual stock return) - SUM(market return).
    Instead, I need to get daily abnormal return, then multiply the 253 days abnormal return together.
    You will find clear steps in the attached workbook. Please input the formula in F101, and it should be applicable to other stocks as well. Appreciate your help!
    Last edited by ily4everrrrr; 11-10-2022 at 01:29 PM.

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

    Re: Looking for the correct formula to retrieve the data

    this is a new question

    CAR 252: Please try (all 4 steps in 1 formula):
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    11-10-2022
    Location
    Hong Kong
    MS-Off Ver
    Microsoft 365
    Posts
    7

    Re: Looking for the correct formula to retrieve the data

    You're my capstone project savior! Another similar situation, no sample workbook is required, can you help with the formula to be input on F101 for the cumulative abnormal return from T-10 to T+10 (total 21 days)?
    Similar to CAR(253) but idk how to amend the formula to count the T-10 days (like looking up for the 10 rows down from T0). Appreciate your help!
    Last edited by ily4everrrrr; 11-11-2022 at 03:27 AM.

  12. #12
    Registered User
    Join Date
    11-10-2022
    Location
    Hong Kong
    MS-Off Ver
    Microsoft 365
    Posts
    7

    Question Re: Looking for the correct formula to retrieve the data

    Test(CAR21&252).xlsx

    Sorry I find the CAR(253) answer is not what I expect D:
    Could you help with both CAR(21) and new CAR(253) formula?
    I have attached the sample workbook with the expected answer and the way to get the answer manually. Can you input the formula for CAR(21) and CAR(253) in the designated cell and the formula could be applicable to other stocks too? Thank you!

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

    Re: Looking for the correct formula to retrieve the data

    Sorry, i calculated CAR 253 in the wrong direction:T(-252) - T(0) instead of T(0) - T(+252).
    And in the end should be 1 subtracted from the result (that was missing in the given calculation steps).

    Here is the corrected formula (changes are in red):
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I also added the formula for CAR 21 to your sheet.
    Attached Files Attached Files
    Last edited by HansDouwe; 11-11-2022 at 07:16 AM.

+ 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] Retrieve the hourly rate for the name of the person in the original cell for correct year
    By cooksley1 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-09-2022, 07:27 PM
  2. formula to retrieve this data?
    By zazzz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-04-2016, 04:46 AM
  3. VB for making the changes in report to retrieve the correct values
    By laansesu in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 02-08-2016, 04:02 AM
  4. Replies: 4
    Last Post: 03-21-2013, 11:35 AM
  5. Web Query needs todays date at end of URL to retrieve correct data
    By the duke in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-08-2013, 01:14 PM
  6. Replies: 1
    Last Post: 07-26-2011, 02:58 AM
  7. Using WebTable to retrieve correct data
    By Bahnzo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-29-2009, 09:52 PM

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