+ Reply to Thread
Results 1 to 3 of 3

Macros - Return a value based on two dates

  1. #1
    Registered User
    Join Date
    03-14-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    31

    Macros - Return a value based on two dates

    Hi,

    I currently have a set of data with some dates that are entered by a user. What i want to do is check whether the dates fall within a particular range and if so, return that range in one cell. The dates may fall in multiple ranges so the ranges may need to be concatenated in once cell. Once one row has been checked, I want the macro to work it's way down the list until there is no more data. I did a bit of reading and I think it might be some kind of do loop with a vlookup perhaps? I'm quite inexperienced with macros so any help would be much appreciated. See attached for a better explanation.

    Cheers
    Attached Files Attached Files
    Last edited by jtd84; 03-26-2012 at 12:08 AM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Macros - Return a value based on two dates

    Try this user defined formula

    Please Login or Register  to view this content.
    Alt F11 to get to the VBA editor. Insert-module. Paste in the above. Alt F11 back to worksheet.

    Paste

    =GetSalesDrives(D4,F4,'Range Lookup Formula'!C11:C23,'Range Lookup Formula'!D11:D22,'Range Lookup Formula'!E11:E23)

    into H4 and copy down.
    Martin

  3. #3
    Registered User
    Join Date
    03-14-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Macros - Return a value based on two dates

    Thanks for the quick response, that worked perfectly

+ 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