+ Reply to Thread
Results 1 to 8 of 8

Formula to search for today's date and return range of data

  1. #1
    Registered User
    Join Date
    03-15-2012
    Location
    va
    MS-Off Ver
    Excel 2007
    Posts
    4

    Formula to search for today's date and return range of data

    Hello. I could really use help writing a formula:

    I want to search for today's date in one worksheet, let's call it Sheet2. When today's date is found, I want a range of data to the right of today's date to be placed/referenced/pasted into another worksheet (the worksheet where the formula is written, or Sheet1). The data range, for example, would be the 5 cells to the right of today's date, and 6 cells down (total of 30 cells) - the range is relative to the date (think of a work schedule). Every day Sheet1 would update with the current day's information/schedule because it searches for today's date.

    Is there a way to accomplish this? Thank you in advance!
    Last edited by paramore; 03-15-2012 at 02:31 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula to search for today's date and return range of data

    You can use Index/Match

    e.g.

    =INDEX('Sheet2'!B:B,MATCH($A2,'Sheet2'!$A:$A,0))

    and copy across.

    this looks for value in A2, finds it in sheet2, column A, then returns item in column B at that row. Copying across gets from C, D, E, etc...
    Last edited by NBVC; 03-15-2012 at 11:35 AM.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    03-15-2012
    Location
    va
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Formula to search for today's date and return range of data

    Thanks, NBVC! Your suggestion is working great. I can capture all the data from across the row, but how about vertical data? For example: today's date is in column A, and last names are in column B, rows 2, 3, and 4. Can I pull a range of columns and rows over to Sheet1? Would I have to have today's date in each corresponding row in column A?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula to search for today's date and return range of data

    Can I pull a range of columns and rows over to Sheet1? Would I have to have today's date in each corresponding row in column A?
    unless there is a consistent number of rows for each date, then it is best you have a date in each row, but there are workarounds using helper columns... if you post a sample workbook (no confidential info included), then we can review it and make suggestions.

  5. #5
    Registered User
    Join Date
    03-15-2012
    Location
    va
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Formula to search for today's date and return range of data

    Here is an example of the data. I want to pull out all of one day's worth of data and place it on a separate sheet, so that others are just looking at one day (the current day) at a time. Then I'd like the sheet to auto-update (presumably using a 'today' formula) so that I am just updating the file once weekly.
    Attached Files Attached Files

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula to search for today's date and return range of data

    So if you have date in Sheet2, cell A1, then in A2:

    =INDEX('Weekly Schedule'!B:B,MATCH($A$1,'Weekly Schedule'!$A:$A,0)+ROWS($A$1:$A2)-2)

    copied down 4 rows and across.

    Assuming each date has 4 rows of data to pull per your sample

  7. #7
    Registered User
    Join Date
    03-15-2012
    Location
    va
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Formula to search for today's date and return range of data

    This is lovely and genius. I can't thank you enough!

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula to search for today's date and return range of data

    You are quite welcome, can you please mark the thread as Solved?



    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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