+ Reply to Thread
Results 1 to 5 of 5

Formula for identifying a date between two others

  1. #1
    Registered User
    Join Date
    10-16-2015
    Location
    Hampshire, England
    MS-Off Ver
    Excel 2013
    Posts
    2

    Unhappy Formula for identifying a date between two others

    I want a formula in cell $B1 which will look at a date in $A1 and put a message in $C1. If the date in $A1 is equal to or less than 30 days before TODAY(), the message in $C1 should read "GREEN". If the date in $A1 is between 31 and 60 days before TODAY(), the message in $C1 should read "AMBER". If the date in $A1 is 61 days or more earlier than TODAY(), the message in $C1 should read "RED".

    I can do the first part; I can do the third part; it is the "between" in the middle section which is making my head hurt. I tried AND, as in if it is more than 31 AND less than 60 but I just can't get the syntax right. Any help gets you on my Christmas list! BTW, I am using Excel 2013 but this formula may be used by someone with 2010 too, so it would need to work on both.

    Many thanks in anticipation of what is probably a simple solution, but one which escapes me.

    regards
    Last edited by Struggling Senior; 10-18-2015 at 07:12 AM. Reason: Heading not acceptable

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: I've been struggling with a formula for two days, so be gentle with me.........

    You dont need a middle bit, just order them from high to low.

    =if(a1>=today()+61,"red",if(a1>=today()+31,"amber","green")

    Explanation:

    If a1 >= today()+61 then red

    if a1 >= today() + 31 it must also be <=today()+61 otherwise we would have already assigned red as the result.

    if the result is neither red nor amber then a1 must be < 31 so assign green.
    Last edited by Special-K; 10-16-2015 at 11:47 AM.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: I've been struggling with a formula for two days, so be gentle with me.........

    Change your subject title (dont ask me how) before a mod comes along...

    Rule 1

    http://www.excelforum.com/forum-rule...rum-rules.html

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: I've been struggling with a formula for two days, so be gentle with me.........

    Hi Struggling Senior, welcome to the forum

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem - not what you think the answer might be. (think google search terms?). Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the address bar)

    Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (note: this change is not optional )
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    10-16-2015
    Location
    Hampshire, England
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: I've been struggling with a formula for two days, so be gentle with me.........

    Heading changed..... hope it's OK now

    regards

+ 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. Struggling with IF formula on my golf spreadsheet
    By m77wls in forum Excel General
    Replies: 4
    Last Post: 09-15-2015, 11:52 AM
  2. [SOLVED] Basic Query, Please be Gentle.. charting secondary info
    By onedevilsstreet in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-12-2015, 06:16 PM
  3. [SOLVED] Struggling with excel formula
    By olegmcnoleg in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-13-2014, 06:37 AM
  4. Hi, please be gentle I'm new to all this.
    By markgolsby in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 06-26-2014, 08:10 PM
  5. [SOLVED] Struggling with COUNTIFS formula - help!
    By Joey_997 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-03-2014, 10:54 AM
  6. struggling with lastrow formula
    By skalaima in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-16-2013, 02:05 PM
  7. [SOLVED] New here so be gentle
    By James D. Connelly in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-18-2005, 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