+ Reply to Thread
Results 1 to 6 of 6

Look up in a range of dates if fall between two dates and result in a value from range

  1. #1
    Registered User
    Join Date
    09-19-2016
    Location
    Muscat, Oman
    MS-Off Ver
    365
    Posts
    56

    Look up in a range of dates if fall between two dates and result in a value from range

    I have two worksheets.

    Worksheet 1: lists all the news events that happened (News). In the A column is the mm/dd/yyyy hh:mm

    Worksheet 2: has the list which contains an Open date and a Close date on each line. The format is the same, which is mm/dd/yyyy hh:mm. The formulas will be in this worksheet.

    I need to write two formulas to accomplish 2 things:

    o find if there is a news event exists no more than x minutes before the opening date and time in the list.
    o find if there is a news event between the opening and closing date and time. If yes, then result the letter in column G of the News worksheet of the item that is closest to the opening date/time in worksheet 2.

    I appreciate any guidance/advice on how to do this? Thanks.

    -Stearno
    Attached Files Attached Files
    Last edited by stearno; 06-07-2020 at 08:47 AM.

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Look up in a range of dates if fall between two dates and result in a value from range

    Please try the following:
    For column Y on the EURUSD - Past Trades Analysis sheet:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note that x is the number of minutes before the opening date and time.
    For column Z:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Registered User
    Join Date
    09-19-2016
    Location
    Muscat, Oman
    MS-Off Ver
    365
    Posts
    56

    Re: Look up in a range of dates if fall between two dates and result in a value from range

    JeteMc,
    Thank you for your suggestions. The second formula works. The only problem with this formula is if it doesn't find it to be true, it results in #Num!. But I can work with that.

    For the first formula, it yeilds #Num! in all rows. When I break the formula apart, it happens inside the Aggregate formula. And it this part of the formula yeilds "0", which I believe is causing the #Num!
    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Look up in a range of dates if fall between two dates and result in a value from range

    Here is a copy of the file with both formulas applied.
    Let us know if you have any questions.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-19-2016
    Location
    Muscat, Oman
    MS-Off Ver
    365
    Posts
    56

    Re: Look up in a range of dates if fall between two dates and result in a value from range

    That is great. Works well. Thank you so much for your help!

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Look up in a range of dates if fall between two dates and result in a value from range

    You're Welcome and thank you for the feedback. If that answers all of your questions, please take a moment to mark the thread as 'Solved' using the thread tools menu above your fist post. I hope that you have a blessed day.

+ 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. Check if range of dates fall between two dates
    By Wasilsky in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-14-2017, 08:40 AM
  2. Calculate days where the range fall between dates
    By sam16 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-06-2017, 09:24 AM
  3. highlight the dates if it fall under certain range
    By hudson andrew in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-06-2016, 11:25 AM
  4. [SOLVED] Counting and specifying dates that fall within a predetermined range
    By devdevdev51 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-30-2015, 04:16 PM
  5. [SOLVED] Averaging values if desired dates fall between range of dates
    By gbcpurdue in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-21-2012, 02:51 PM
  6. Need Sumif to count dates that fall within a range of dates
    By Paralegal101 in forum Excel General
    Replies: 1
    Last Post: 09-12-2011, 02:26 PM
  7. check if dates fall within a range
    By mcinnes01 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-28-2011, 01:15 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