+ Reply to Thread
Results 1 to 8 of 8

20 Day look back from last entry

  1. #1
    Registered User
    Join Date
    10-15-2023
    Location
    New York, New York
    MS-Off Ver
    2019
    Posts
    88

    20 Day look back from last entry

    I have a sheet in my attached spreadsheet with columns of dates, day, day and time, price in column A, B, C, D, E.

    How do I make a formula in a cell in the sheet "Lookback" that will look at the last entry in the columns, update automatically everytime I add data, and tell me the
    high and low of the last 20 days/40 days/60 days?

    Thank you in advance and please do not hesitate to ask if I did not explain this clearly enough.

    Thanks again.

    Ivan
    Attached Files Attached Files

  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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,426

    Re: 20 Day look back from last entry

    It would help if you provided some expected results and annotations in the workbook.
    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
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,139

    Re: 20 Day look back from last entry

    High and low of WHICH column?

    Are there ALWAYS measurements EVERY day? It seems that some days are msssing. So is 20 days 20 days with data or (for example) 18 days with data and two days, within the date range, with no data?

    Are the data in ascending date/time order? They seem to be... but there are FUTURE dates and out-of-sequence dates near the end.

    THINK about what you are giving us and provide a complete explanation, please.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  4. #4
    Registered User
    Join Date
    10-15-2023
    Location
    New York, New York
    MS-Off Ver
    2019
    Posts
    88

    Re: 20 Day look back from last entry

    Hi Glenn,

    It would be the high and low of the price column.

    There are not measurements everyday. It would be 20 days with data.

    Data should be in ascending time order. This spreadsheet got passed back and forth a bit I didn't notice the out of date order in the end. it doesn't matter.

    Missing days do not matter, there is no data from Friday 6:00 pm to Sunday 6:00 pm and other holidays.

    We are looking for the lowhigh made in the last 20 days from the last entry.

    Is this explanation complete?

    Thanks

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,139

    Re: 20 Day look back from last entry

    Yes. However, your raw data were a mess. Past dates have date/times and NO price. I assume that is a result of being "passed back and forth". I deleted those rows.

    A helper is needed (column A) to return unique dates in descending order:


    =IFERROR(INDEX('IDATA (2)'!A:A,AGGREGATE(14,6,ROW('IDATA (2)'!$A$2:$A$1000)/(('IDATA (2)'!$A$2:$A$1000<>"")*(COUNTIF(A$1:A1,'IDATA (2)'!$A$2:$A$1000)=0)),1)),"")

    copied down. Adjust the range as needed, but don't go mad and make them whole columns... unless you have close to 1,000,000 rows.

    Set the number of days in E1 and use MAXIFS and MINIFS:

    =MAXIFS('IDATA (2)'!E2:E10000,'IDATA (2)'!A2:A10000,">="&INDEX(A:A,E1+1))
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-15-2023
    Location
    New York, New York
    MS-Off Ver
    2019
    Posts
    88

    Re: 20 Day look back from last entry

    Thanks Brett,

    I can see what you mean by stating the problem better.

    I am trying to piece together your logic and it's my mistake again for not putting the page referencing the IDATA.

    I am attempting to match the forumla in the page I have as "LOOK"

    The column N is the unique dates and the columns with the 60, 40, 20 day high and lows are in columns B - G

    I can't get it to work. I am using excel 2019......is that why?

    Can you take a look again please?

    Thanks,
    Attached Files Attached Files

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,139

    Re: 20 Day look back from last entry

    Brett??

    Anyhow.

    the results may look odd, but if you recall I had deleted a lot of incoherent data in IDATA(2).

    see file. If this is not yet correct, amend your file to show AT LEAST one set of expected results that CAN be derived from the available data.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    10-15-2023
    Location
    New York, New York
    MS-Off Ver
    2019
    Posts
    88

    Re: 20 Day look back from last entry

    OMG I apologize Glenn.........excel forum isn't letting me upload a file with the full data........there are only around 26,000 data points per year.........it's saying the file is too large
    the problem is I have to reference data from other files I make one per year......

+ 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. Send Cursor Back To Textbox After Invalid Entry
    By Jenn68 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-30-2022, 12:01 PM
  2. [SOLVED] Setting focus back to textbox after cell populate for next entry
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-14-2017, 11:50 AM
  3. [SOLVED] Year to month and back - entry formula to itself
    By olwy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-15-2014, 08:38 AM
  4. Replies: 2
    Last Post: 06-07-2013, 09:08 AM
  5. [SOLVED] How do I get the date entry bar back (at top of sheet)?
    By Linzsocal in forum Excel General
    Replies: 1
    Last Post: 07-17-2006, 01:20 PM
  6. How take form based data entry back to main sub?
    By Chet in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-10-2006, 04:45 PM
  7. [SOLVED] [SOLVED] How take form based data entry back to main sub?
    By Chet in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-10-2006, 03:59 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