+ Reply to Thread
Results 1 to 17 of 17

how to take value of variable data with time.

  1. #1
    Registered User
    Join Date
    11-10-2016
    Location
    Sri Lanka
    MS-Off Ver
    2010
    Posts
    77

    Exclamation how to take value of variable data with time.

    There is two rows.One row is time other one changing value with time.I want to take value of specific time and unchange.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,560

    Re: how to take value of variable data with time.

    Attach a sample workbook. 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
    11-10-2016
    Location
    Sri Lanka
    MS-Off Ver
    2010
    Posts
    77

    Re: how to take value of variable data with time.

    please check my attachment.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,560

    Re: how to take value of variable data with time.

    How is time/price changed as you need to capture time within 1 minute of the hour e.g. 0900:0901

  5. #5
    Registered User
    Join Date
    11-10-2016
    Location
    Sri Lanka
    MS-Off Ver
    2010
    Posts
    77

    Re: how to take value of variable data with time.

    No.Price change withing 1 second ,2 second or 1 minute ............like that. That is no need to consider, I need when my time comes to time row first value should copy and after that no change.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,560

    Re: how to take value of variable data with time.

    in E3

    =IF($A$3=D3,$B$3,0)

    Copy down

    Price will remain unchanged for 24 hours.

    You may want to put some "tolerance" on the check ie, within +/- 10 seconds.

  7. #7
    Registered User
    Join Date
    11-10-2016
    Location
    Sri Lanka
    MS-Off Ver
    2010
    Posts
    77

    Re: how to take value of variable data with time.

    It is not working after one minute. it was changed.Time row time changing 9:01:1, 9:01:25, 9:01:37,.................like that.That time was changed price also changed.My attachment mention time is wrong.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,560

    Re: how to take value of variable data with time.

    Hence the need for a "tolerance" to be applied to the check of A3 vs D3. It will be (almost) pure chance you get an exact match to the second.

  9. #9
    Registered User
    Join Date
    11-10-2016
    Location
    Sri Lanka
    MS-Off Ver
    2010
    Posts
    77

    Re: how to take value of variable data with time.

    I can apply 30second tolerance.please send me formula.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,560

    Re: how to take value of variable data with time.

    Try

    =IF(AND($A$3-TIME(0,0,30)<=D3,$A$3+TIME(0,0,30)>=D3),$B$3,0)

    so time of 090:00, then (inclusive) time between 08:59:30 and 09;00:30 will return a result
    Last edited by JohnTopley; 11-12-2016 at 02:43 AM.

  11. #11
    Registered User
    Join Date
    11-10-2016
    Location
    Sri Lanka
    MS-Off Ver
    2010
    Posts
    77

    Re: how to take value of variable data with time.

    Sir,

    That function take value.But

    When time and price change but price value should be unchanged.
    for example,
    At 10:00:00 price is 0.4578.
    time will come 10:30:45 and price will come 0.4124.but price value column not change, it should be 0.4578.

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,560

    Re: how to take value of variable data with time.

    So under what conditions does the price change???

    My test for 30 SECONDS not 30 minutes!

  13. #13
    Registered User
    Join Date
    11-10-2016
    Location
    Sri Lanka
    MS-Off Ver
    2010
    Posts
    77

    Re: how to take value of variable data with time.

    sir,
    Price column value change any time, like a stock market. I need time match with my time (D3) Price will appear in E3. That price will not change 59 minute.

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,560

    Re: how to take value of variable data with time.

    It will not change with my formula if the time is +/- 30 seconds of your time in D3 PROVIDING you have hourly intervals.

  15. #15
    Registered User
    Join Date
    11-10-2016
    Location
    Sri Lanka
    MS-Off Ver
    2010
    Posts
    77

    Re: how to take value of variable data with time.

    A3 and D3 time is matching and E3 price appear. After 30 second that E3 value going to 0. But i want E3 value not change withing 1 hour.

  16. #16
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,560

    Re: how to take value of variable data with time.

    If the value in E is to remain constant (once set) then you will need VBA to do this as you cannot have both a formula and (an unchanging) cell value based on that formula.

    You probably need Worksheet Event macro.

  17. #17
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,560

    Re: how to take value of variable data with time.

    Rght click on Sheet1 and click "View Code" (already done in Attachment)

    Copy and paste code below:

    Please Login or Register  to view this content.
    Change time/price in A3/B3 to test

    Hopefully this will work with a real time feed.
    Attached Files Attached Files
    Last edited by JohnTopley; 11-15-2016 at 02:19 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] Run-time error '91': Object variable or With block variable not set when closing userform
    By bishoposiris in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2016, 08:59 AM
  2. [SOLVED] Run-time error 91: Object variable or With block variable not set
    By onmyway in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2015, 09:29 AM
  3. Replies: 0
    Last Post: 04-16-2013, 07:15 AM
  4. Replies: 6
    Last Post: 12-21-2012, 08:03 AM
  5. Replies: 1
    Last Post: 09-25-2012, 08:03 PM
  6. [SOLVED] Intermittent Run-time Error 91: Object Variable or With Block variable not set
    By fraanchtoast in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-29-2012, 10:11 AM
  7. Run Time Error 91 Object variable or With block variable not set
    By h_aesa1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-07-2009, 03:21 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