+ Reply to Thread
Results 1 to 5 of 5

Assigning a category to a specific time frame

  1. #1
    Registered User
    Join Date
    03-15-2013
    Location
    New Orleans
    MS-Off Ver
    Excel 2007
    Posts
    3

    Assigning a category to a specific time frame

    I have a spreadsheet that calculates the amount of time between 2 dates. I need to take that the years, months, and days and categorize it into one of 4 different categories, such as "< 3 months" or "3-6 months" or "7-12 months" or "1-2 years" and have that go into a separate cell. Can anyone help me with this? PLEASE!?!?!?!?!

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Assigning a category to a specific time frame

    Is this the output you are looking for? Because I wasn't sure...
    Attached Files Attached Files
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Registered User
    Join Date
    03-15-2013
    Location
    New Orleans
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Assigning a category to a specific time frame

    This is almost. but not using the TODAY functions. I have a begin and end date.
    Attached Files Attached Files

  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Assigning a category to a specific time frame

    hi Woofaloo, welcome to the forum. you can use DATEDIF.
    =IF(DATEDIF($A2,$B2,"m")<3,"X","")

    DATEDIF($A2,$B2,"m")
    this gives you the number of months between 2 dates. so if it's lesser than 3, show as "X".

    to put in 2 ranges like 3-6, add the AND formula:
    =IF(AND(DATEDIF($A2,$B2,"m")>=3,DATEDIF($A2,$B2,"m")<=6),"X","")

    it's similar for the rest. for years, you can use 12 months x number of years or use DATEDIF(($A2,$B2,"y")

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  5. #5
    Registered User
    Join Date
    03-15-2013
    Location
    New Orleans
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Assigning a category to a specific time frame

    Thank YOU!!! That is want I was looking for. Perfect!!

+ 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