+ Reply to Thread
Results 1 to 11 of 11

Need Formula for Data that Shifts When It Updates

  1. #1
    Forum Contributor
    Join Date
    10-05-2010
    Location
    CA
    MS-Off Ver
    Excel 365
    Posts
    539

    Question Need Formula for Data that Shifts When It Updates

    SEE POST #10 FOR A BETTER BREAKDOWN AND SPREADSHEET

    I have a spreadsheet that is updated with new data every 15 minutes. It’s pasted in using a macro. There are 1000 lines of data and when a new line is added the oldest line falls off. The columns next to this constantly updated data are static formulas and rules that are always the same. The problem I’m having is when and update takes place the static rules are thrown off. The only time they matchup is at the top of an odd number hour (3:00, 5:00, 7:00, 9:00, 11:00, 13:00 etc.)

    It takes (8) 15 minute intervals (cycles) before the static columns are correct again. I need a formula that finds the open, high, low, and close, between two “X” s, which mark the two hour change. More information can be found in the spreadsheet attached.

    Can someone help me allowing the data to update but calculates the way I need it to based on the static data?

    Breakdown of Formulas Needed for Each Column
    DATE: Either the current date for that row if above lower "X" or the date at "X"

    TIME: The time for the nearest "X"

    OPEN: Is the first instance between two "X"s for all rows
    #
    1000 High: First row between two "X"s
    999 High: MAX Between 1st and 2nd row between two "X"s
    998 High: MAX Between 1st through 3rd row between two "X"s
    997 High: MAX Between 1st through 4th row between two "X"s
    996 High: MAX Between 1st through 5th row between two "X"s
    995 High: MAX Between 1st through 6th row between two "X"s
    994 High: MAX Between 1st through 7th row between two "X"s
    993 High: MAX Between 1st through 8th row between two "X"s
    #
    1000 Low: First row between two "X"s
    999 Low: MIN Between 1st and 2nd row between two "X"s
    998 Low: MIN Between 1st through 3rd row between two "X"s
    997 Low: MIN Between 1st through 4th row between two "X"s
    996 Low: MIN Between 1st through 5th row between two "X"s
    995 Low: MIN Between 1st through 6th row between two "X"s
    994 Low: MIN Between 1st through 7th row between two "X"s
    993 Low: MIN Between 1st through 8th row between two "X"s

    CLOSE: Either the current Close for that row if above lower "X" or the Close at "X"

    VOLUME: Add the vaule of current row plus the values above until the upper "X"

    Please see spreadsheet for a better understanding.

    Any and all help you could provide for any of the formulas would be greatly appreciated. Thank you.
    Attached Files Attached Files
    Last edited by artiststevens; 04-20-2014 at 07:33 PM.

  2. #2
    Forum Contributor
    Join Date
    10-05-2010
    Location
    CA
    MS-Off Ver
    Excel 365
    Posts
    539

    Question Re: Need Formula for Data that Shifts When It Updates

    Simplified Rules and Table to Better Illustrate My Desired Outcomes

    Data shifts and is not static so formulas have to be based on the "X"s. Please see updated spreadsheet for a better understanding.

    All of the formulas are entered in columns K3:Q10

    A B C D E F G H I J K L M N O P Q
    1 # DATE TIME OPEN HIGH LOW CLOSE VOL MARK # DATE TIME OPEN HIGH LOW CLOSE VOL
    2 x
    3 1000 4/3/2014 1:00 1.3764 1.3765 1.3760 1.3764 684 1 4/3/2014 1.3764 1.3765 1.3760 1.3764 684
    4 999 4/3/2014 1:15 1.3764 1.3764 1.3760 1.3761 780 1 4/3/2014 1.3764 1.3765 1.3760 1.3761 1464
    5 998 4/3/2014 1:30 1.3764 1.3765 1.3760 1.3764 684 1 4/3/2014 1.3764 1.3765 1.3760 1.3764 2148
    6 997 4/3/2014 1:45 1.3764 1.3764 1.3760 1.3761 780 1 4/3/2014 1.3764 1.3765 1.3760 1.3761 2928
    7 996 4/3/2014 2:00 1.3761 1.3766 1.3759 1.3765 709 1 4/3/2014 1.3764 1.3766 1.3759 1.3765 3637
    8 995 4/3/2014 2:15 1.3766 1.3769 1.3765 1.3765 405 1 4/3/2014 1.3764 1.3769 1.3759 1.3765 4042
    9 994 4/3/2014 2:30 1.3765 1.3768 1.3764 1.3765 411 1 4/3/2014 1.3764 1.3769 1.3759 1.3765 3769
    10 993 4/3/2014 2:45 1.3765 1.3766 1.3763 1.3765 218 X 1 4/3/2014 2:45 1.3764 1.3769 1.3759 1.3765 4671

    All of the fomulas are entered in columns K3:Q10

    K3:K10 DATE: Either the current date for that row if above lower "X" or the date at "X"

    L3:L10 TIME: The time for the "X" in that row or the "X" above it.

    M3:M10 OPEN: Is the first open between the nearest top two "X"s

    N3 HIGH: First row at or above "X"s
    N4 HIGH: MAX Between 1st and 2nd row at or above two "X"s
    N5 HIGH: MAX Between 1st through 3rd row at or above two "X"s
    N6 HIGH: MAX Between 1st through 4th row at or above "X"s
    N7 HIGH: MAX Between 1st through 5th row at or above "X"s
    N8 HIGH: MAX Between 1st through 6th row at or above "X"s
    N9 HIGH: MAX Between 1st through 7th row at or above "X"s
    N10 HIGH: MAX Between 1st through 8th row at or above "X"s

    O10 LOW: First row at or above "X"s
    O11 LOW: MIN Between 1st and 2nd row at or above "X"s
    O12 LOW: MIN Between 1st through 3rd row at or above "X"s
    O13 LOW: MIN Between 1st through 4th row at or above "X"s
    O14 LOW: MIN Between 1st through 5th row at or above "X"s
    O15 LOW: MIN Between 1st through 6th row at or above "X"s
    O16 LOW: MIN Between 1st through 7th row at or above "X"s
    O17 LOW: MIN Between 1st through 8th row at or above "X"s

    P3:P10 CLOSE: Either the current Close for that row if above lower "X" or the Close at "X"

    Q3:Q10 VOLUME: Add the vaules of current row plus the values above until the upper "X"


    Any help that can be provided for any of the formulas I need would be greatly appreciated Thank you.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    10-05-2010
    Location
    CA
    MS-Off Ver
    Excel 365
    Posts
    539

    Re: Need Formula for Data that Shifts When It Updates

    Any help that can be provided for any of the formulas I need would be greatly appreciated Thank you.

  4. #4
    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,673

    Re: Need Formula for Data that Shifts When It Updates

    Quote Originally Posted by artiststevens View Post
    Any help that can be provided for any of the formulas I need would be greatly appreciated Thank you.
    I think you'd get a better response if you provided a sample workbook instead of expecting would-be helpers to spend time replicating your data.
    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.

  5. #5
    Forum Contributor
    Join Date
    10-05-2010
    Location
    CA
    MS-Off Ver
    Excel 365
    Posts
    539

    Re: Need Formula for Data that Shifts When It Updates

    Quote Originally Posted by AliGW View Post
    I think you'd get a better response if you provided a sample workbook instead of expecting would-be helpers to spend time replicating your data.
    Hello Ali,
    Thank you for the response. I provided a sample workbook in Post#1 and Post#2. I created the table to just to further illustrate what I'm trying to accomplish. See post #2 or this post for the most updated workbook.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: Need Formula for Data that Shifts When It Updates

    G'day

    I've have had a go at this challenge tho my time is limited working on this, but I also have to ask...........

    Do you need totally presentation of the whole time (24hrs) or just a snapshot of a certain time frame ?
    Have I made you happy ??? If yes, please make me happy by pressing the http://www.excelforum.com/images/buttons/reputation-40b.png Add Reputation button in my post.
    Please don't forget to do the same to other contributors of this forum.

    Thanks
    I don't void confusion, I create it

  7. #7
    Forum Contributor
    Join Date
    10-05-2010
    Location
    CA
    MS-Off Ver
    Excel 365
    Posts
    539

    Re: Need Formula for Data that Shifts When It Updates

    G’day Ratcat and thank you for replying. I’d greatly appreciate it if you made a go at this challenge even if you only helped find the solution to just one of the formulas I need.

    I would need the whole 24hrs not just a snapshot. If you have any other questions feel free and ask.

    Thanks again.

  8. #8
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: Need Formula for Data that Shifts When It Updates

    G'day,

    Hope this helps. Please note I didn't complete the Open and Close columns as I'm unsure of the results you're looking for.

    Please test the workbook. Personally its a bit rough but hey it works
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    10-05-2010
    Location
    CA
    MS-Off Ver
    Excel 365
    Posts
    539

    Re: Need Formula for Data that Shifts When It Updates

    G'day Ratcat,
    Rough is an understatement. I'm going to review it and test everything but before I do I wanted to say thank you for using some of your time and energy to helping me resolve this problem. Thank you.

  10. #10
    Forum Contributor
    Join Date
    10-05-2010
    Location
    CA
    MS-Off Ver
    Excel 365
    Posts
    539

    Question Re: Need Formula for Data that Shifts When It Updates

    G'day Ratcat,
    So I made some changes to the workbook you uploaded and it works fine with the current data but when I pasted in the complete data set all of the formulas are out of whack.

    Also, can you tell where I can edit [db!] in the Name Manager? I see the Refers To but I can’t figure out what it refers to. I think that’s what needs to be changed.

    I’m attaching two spreadsheets one titled shifting_data_5 which has the changes to the workbook you uploaded and shifting_data_6 which is another workbook that contains your formulas but with updated data. The second workbook is where the results are all out of whack. See the shifting_data_5 for the changes and for updates to the rules and a better understanding of what I'm trying to accomplish.

    Thank you again for assisting me with this Ratcat. It’s greatly appreciated.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    10-05-2010
    Location
    CA
    MS-Off Ver
    Excel 365
    Posts
    539

    Re: Need Formula for Data that Shifts When It Updates

    Any help that can be provided for any of the formulas I need would be greatly appreciated 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. edit existing formula for shifts and hours
    By david87654321 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-17-2014, 10:05 AM
  2. [SOLVED] Formula to create 3 shifts for 24 hour period
    By Justair07 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-29-2013, 10:04 AM
  3. [SOLVED] Need a formula to check shifts in a roster
    By arifmasum in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-25-2012, 01:46 AM
  4. Replies: 1
    Last Post: 01-02-2012, 02:47 PM
  5. IF Formula working with work shifts
    By DGutterud in forum Excel General
    Replies: 5
    Last Post: 05-19-2011, 08:23 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