+ Reply to Thread
Results 1 to 2 of 2

Help with IF function

  1. #1
    Registered User
    Join Date
    MS-Off Ver
    Excel 2003

    Help with IF function

    I need help with an IF function. I have a column of dates that I want evaluated. If the date is less than 6 months ago from today, I want to return a value. If the date is between 7-12 months from today, return another value. If between 1-2 years from today, another value. And lastly, if greater than 2 years, return another value. Can someone please help me?

  2. #2
    Registered User
    Join Date
    MS-Off Ver
    Excel 2010

    Re: Help with IF function

    Suppose [A1] has the date you want evaluated. This should work:

    =IF((TODAY()-A1)<180,"Less than 6mos",IF(AND((TODAY()-A1)>180,(TODAY()-A1)<365),"Between 6 and 12",IF(AND((TODAY()-A1)>365,(TODAY()-A1)<730),"Between 1 and 2","Greater than 2yrs")))

    Note- this won't consider leap year
    Last edited by learning_vba; 01-30-2014 at 09:27 PM. Reason: Found an error in formula

+ 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: 01-15-2014, 11:40 PM
  2. index function error using match function to get data from a cell in an array
    By mabildgaard in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-17-2013, 02:21 AM
  3. [SOLVED] Using Offset function as the array in the PercentRank function is giving wrong result
    By Bobneil in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-06-2013, 09:29 PM
  4. Replies: 1
    Last Post: 03-21-2012, 11:22 AM
  5. [SOLVED] Excel - User Defined Function Error: This function takes no argume
    By BruceInCalgary in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2006, 04:05 PM


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