+ Reply to Thread
Results 1 to 7 of 7

Need formula to return certain cell based on the current date

  1. #1
    Registered User
    Join Date
    08-05-2016
    Location
    Philadelphia, PA
    MS-Off Ver
    2013
    Posts
    24

    Need formula to return certain cell based on the current date

    Hello all!

    I am sure there is a simple solution to this that I'm over complicating. I need a formula that returns the number in the cell that corresponds to that days date. Basically, if today is 9/27/16, and my table looks like this:

    9/8/16 9/22/16 10/6/16 10/20/16 11/3/16 11/17/16
    Purple 8 11 14 17 20 23
    Green 10 13 16 19 22 25
    Yellow 12 15 18 21 24 27
    Blue 14 17 20 23 26 29

    I want my other chart to populate with the correct numbers based on the date ranges provided (for 9/27, the numbers would be from column 9/22, any date between 10/6 and 10/20 would return the numbers from 10/6, etc.):

    Current Colors
    Purple
    Green
    Yellow
    Blue

    Any help is appreciated!

    Thank you,
    Meg

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: Need formula to return certain cell based on the current date

    It would have helped if you had told us which cells you are using for your data. Assuming your main table occupies the range A1:G5, and that your (lower) colour purple is in cell A11, then you can use this formula in cell B11:

    =IFERROR(INDEX($B$2:$G$5,MATCH(A11,$A$2:$A$5,0),MATCH(TODAY(),$B$1:$G$1)),"")

    Then copy this formula down.

    Hope this helps.

    Pete

  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,053

    Re: Need formula to return certain cell based on the current date

    Is this what you wanted:
    =IFERROR(INDEX($B$2:$F$5,MATCH(B9,$A$2:$A$5,0),MATCH($C$8,$B$1:$F$1,1)),"")
    Where C8 is the date to be searched and B9 to b12 is a list of the colours.
    Attached Files Attached Files
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Need formula to return certain cell based on the current date

    Enter in C9 and copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B C D E F
    1 9/8/2016 9/22/2016 10/6/2016 10/20/2016 11/3/2016
    2 Purple 8 11 14 17 20
    3 Green 10 13 16 19 22
    4 Yellow 12 15 18 21 24
    5 Blue 14 17 20 23 26
    6
    7
    8 9/22/2016
    9 Purple 11
    10 Green 13
    11 Yellow 15
    12 Blue 17
    13
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    Registered User
    Join Date
    08-05-2016
    Location
    Philadelphia, PA
    MS-Off Ver
    2013
    Posts
    24

    Re: Need formula to return certain cell based on the current date

    Perfect!

    Thanks so much!

    Meg

  6. #6
    Registered User
    Join Date
    08-05-2016
    Location
    Philadelphia, PA
    MS-Off Ver
    2013
    Posts
    24

    Re: Need formula to return certain cell based on the current date

    Quote Originally Posted by Glenn Kennedy View Post
    Is this what you wanted:
    =IFERROR(INDEX($B$2:$F$5,MATCH(B9,$A$2:$A$5,0),MATCH($C$8,$B$1:$F$1,1)),"")
    Where C8 is the date to be searched and B9 to b12 is a list of the colours.
    Perfect!!

    Thanks,
    Meg

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Need formula to return certain cell based on the current date

    Corrected formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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] Loop through last row to return a value based on value of current cell
    By sammar12 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-07-2016, 01:13 PM
  2. [SOLVED] Formula to automatically return date in correct cell based on date given
    By MichelleD75 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-10-2016, 01:29 PM
  3. How to automatically update a formula based on current date
    By stealthtrooper in forum Excel General
    Replies: 5
    Last Post: 04-22-2014, 04:12 PM
  4. [SOLVED] Date Formula to Return Week Number in Current Month based on Reporting Period
    By jeversf in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-25-2013, 12:10 PM
  5. Replies: 11
    Last Post: 07-01-2012, 03:51 AM
  6. Formula based on current date.
    By Kdellicker in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-11-2010, 11:12 AM
  7. Current date formula based on month
    By Renz09 in forum Excel General
    Replies: 2
    Last Post: 05-05-2006, 02:04 AM

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