+ Reply to Thread
Results 1 to 10 of 10

LOOKUP TODAY function within a date range to return a value

  1. #1
    Registered User
    Join Date
    04-22-2013
    Location
    Bristol, England
    MS-Off Ver
    Excel 365
    Posts
    29

    LOOKUP TODAY function within a date range to return a value

    Hello I am trying to return a value from a database based upon today's date, a simplified example of the sheet is attached.
    Also my method of populating successive months is rather crude and I'm sure could be better stated! Any assistance much appreciated
    Book 04_12_13.xlsx

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: LOOKUP TODAY function within a date range to return a value

    d2 1/8/2013
    e2 filled across
    =eomonth(D2,0)+1
    to get decembers value
    =LOOKUP(B5,D4:N4)
    Last edited by martindwilson; 12-04-2013 at 08:21 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    04-22-2013
    Location
    Bristol, England
    MS-Off Ver
    Excel 365
    Posts
    29

    Re: LOOKUP TODAY function within a date range to return a value

    Thanks Martin, works perfectly on my simplified example but not in the real thing. I think I can see that your formula effectively takes the last populated number. In other words Jan 14 cant be populated and so today's date will always reflect the current months data, and that would work but..... the data is populated by the formula =SUMPRODUCT(--(!ISNUMBER(H4:H16)),--(H4:H16>0),$C10:$C20) for whatever reason this formula applied in Column H (December) and successively thereafter I (January) etc returns a zero in the future months and so your formula picks up on the last of these and thus returns zero. Perhaps its as simple as reformatting the cells to remain blank instead of returning zero?

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: LOOKUP TODAY function within a date range to return a value

    oops
    decembers value would be
    =LOOKUP(B5,D2:N2,D4:N4)

  5. #5
    Registered User
    Join Date
    04-22-2013
    Location
    Bristol, England
    MS-Off Ver
    Excel 365
    Posts
    29

    Re: LOOKUP TODAY function within a date range to return a value

    oddly this fix returns 564.80 which is the Nov-13 figure, instead of the December figure?

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: LOOKUP TODAY function within a date range to return a value

    not for me,did you fix the date ranges? if you leave them as they are h2 =15/dec lookup today() cant be found there so it returns the next lowest which is 14 november
    Attached Files Attached Files
    Last edited by martindwilson; 12-04-2013 at 10:32 AM.

  7. #7
    Registered User
    Join Date
    04-22-2013
    Location
    Bristol, England
    MS-Off Ver
    Excel 365
    Posts
    29

    Re: LOOKUP TODAY function within a date range to return a value

    No I didn't!.... apologies...and thanks for that clean up as well. Outstanding!

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: LOOKUP TODAY function within a date range to return a value

    Does this do what you want?
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  9. #9
    Registered User
    Join Date
    04-22-2013
    Location
    Bristol, England
    MS-Off Ver
    Excel 365
    Posts
    29

    Re: LOOKUP TODAY function within a date range to return a value

    Hi Ron, your method also works, thank you

  10. #10
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: LOOKUP TODAY function within a date range to return a value

    You're welcome. There is usually more than one way to solve a problem. Choose what works best for 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. Replies: 2
    Last Post: 12-31-2012, 12:47 PM
  2. Formula to search for today's date and return range of data
    By paramore in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-15-2012, 02:17 PM
  3. [SOLVED] SUMIF within date range as a function of today()'s date
    By irvine79 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-06-2006, 01:00 PM
  4. MAX figure within a date range as a function of today()'s date
    By irvine79 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-06-2006, 12:45 PM
  5. [SOLVED] how can I return todays date (today() ) in an if function
    By Sally in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-08-2006, 08:00 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