+ Reply to Thread
Results 1 to 8 of 8

if a date falls within 15 months of current date to pull data (see thread)

  1. #1
    Registered User
    Join Date
    08-23-2011
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    5

    if a date falls within 15 months of current date to pull data (see thread)

    I need some help.

    I have removed the names and data to preserve information, however I need to create a function or IF statement that will do the following.

    This is what i need...If the dates on (date one) colum fall within 15months of todays date i need it to show up with name and date in (Sheet Date 1)

    So lets say (Name One) and the date 8/6/1996 falls with in 15 months of todays date... on (Sheet date 1) I need the name of the person and the date to show up.

    Is this at all possable. Im pulling my hair out with arrays n stuff. Thanks
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: if a date falls within 15 months of current date to pull data (see thread)

    Try this code:
    Please Login or Register  to view this content.
    See attached workbook. Note that it will ONLY pull name four since it is the only one 450 days old or less.
    Attached Files Attached Files
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  3. #3
    Registered User
    Join Date
    08-23-2011
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: if a date falls within 15 months of current date to pull data (see thread)

    Thanks for the quick reply ... Ill have to try this at home.. my work does not allow the option to enable macros ill post later and let you know thanks again

  4. #4
    Registered User
    Join Date
    08-23-2011
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: if a date falls within 15 months of current date to pull data (see thread)

    Ok it is returning name only.

    Is there a way to return (name one) plus it there a way to return that date too. So out of the main sheet on the front lets say name one is the only one from your macro that should be returned can it return

    (name one) and date

  5. #5
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: if a date falls within 15 months of current date to pull data (see thread)

    I needed to change a line of code:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by tlafferty; 08-24-2011 at 06:20 PM. Reason: forgot to close code brackets

  6. #6
    Registered User
    Join Date
    08-23-2011
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: if a date falls within 15 months of current date to pull data (see thread)

    ok I attached the real excel sheet I have been using this was getting messy.

    If you look I updated the macro according to my sheet. However it is not returning the names it is returning the date next to the date so it is showing up two date instead on name and date.

    also i am new to this however it is only showing dates from today out to 15months? Thanks again.
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: if a date falls within 15 months of current date to pull data (see thread)

    Code has been adjusted to pull from specified columns. Note that it will only pull in data that is within 450 days of the current date (roughly the last 15 months if you consider each month to be exactly 30 days). If you want to pull a different date range, let me know and I will adjust it for you.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    08-23-2011
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: if a date falls within 15 months of current date to pull data (see thread)

    thanks again... it is still pulling all the dates for some reason even if I make date - 100 it still pulls all the dates. Am I doing something wrong? Thanks again

+ 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