+ Reply to Thread
Results 1 to 5 of 5

If statement using dates

  1. #1
    Registered User
    Join Date
    04-07-2017
    Location
    Santa Rosa Beach, Florida
    MS-Off Ver
    2016
    Posts
    30

    If statement using dates

    This is what I need in English where B1 is today's date and A1 is a date before today. Basically we cannot service a property until at least 2 months have passed since we did the last service.

    If B1 is 2 months or more past A1, then type "Ready" in green in C1.
    If B1 is less than 2 months past A1, then type "No" in red in C1.

    I cannot figure out the 2 months part bc someone thought it would be a spectacular idea to have months with varying numbers of days in them. Thank you Pope Greg.

    Thanks.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,855

    Re: If statement using dates

    Use the Datedif function. https://exceljet.net/excel-functions...tedif-function
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,697

    Re: If statement using dates

    You could use a formula like this:

    =IF($B$1-A1>=IF(MONTH(A1)<=2,60,IF(OR(MONTH(A1)=7,MONTH(A1)=12),62,61)),"yes","no")

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    04-07-2017
    Location
    Santa Rosa Beach, Florida
    MS-Off Ver
    2016
    Posts
    30

    Re: If statement using dates

    Yes, it works. THANKS!!!

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,697

    Re: If statement using dates

    That's good to hear.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    You might also like to know that you can show your appreciation directly and thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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. Using IF/AND statement for dates
    By Munnah in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-24-2019, 06:01 AM
  2. IF statement with dates
    By fatboylard in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-16-2019, 07:45 AM
  3. Using dates in an IF statement
    By scubadiver007 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-21-2017, 01:25 PM
  4. [SOLVED] Add a between 2 dates to an IF statement
    By myobreportguru in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 08-18-2016, 10:55 AM
  5. If Statement Between 2 Dates
    By Chia4 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-13-2016, 08:19 PM
  6. If Statement and dates
    By Cageyj0nny in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-11-2014, 08:03 AM
  7. using dates in IF statement
    By bigchuda in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-28-2008, 02:55 PM

Tags for this Thread

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