+ Reply to Thread
Results 1 to 4 of 4

How to check whether a date is a month after the previous date

  1. #1
    Registered User
    Join Date
    11-29-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    46

    How to check whether a date is a month after the previous date

    Hi all,

    Can anyone help me with the below question?

    I’m sent a file every day where column A contains a month & year but in ‘general’ format.

    For example;

    Column A, starting with cell A1 with the next date in A2, etc
    Jan15
    Feb15
    Mar15
    Apr15

    Is there a way through a formula or macro that I can use in order to run through all the dates in this column to make sure that the next cell down is always the month after the cell above it? The dates go all the way through to 2018 in the above format.

    Any help would be much appreciated.

    Thank you.
    Last edited by Bandicoot; 12-12-2013 at 07:28 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,576

    Re: How to check whether a date is a month after the previous date

    You can use conditional formatting like =MONTH(A1)>MONTH(A2)

  3. #3
    Forum Contributor
    Join Date
    01-30-2013
    Location
    Wales
    MS-Off Ver
    Excel 2013
    Posts
    231

    Re: How to check whether a date is a month after the previous date

    In B1
    IF(DATE(YEAR(A2),MONTH(A2),1)=DATE(YEAR(A1),MONTH(A1)+1,1),"GOOD","ERROR")

    Change the text "GOOD" and "ERROR" to whatever you want it to be.

    Copy formula down

    Chris
    Last edited by Chris 53; 12-12-2013 at 07:17 AM.

  4. #4
    Registered User
    Join Date
    11-29-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: How to check whether a date is a month after the previous date

    Zbor & Chris,

    Thank you both very much!

+ 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. SQL: First and Last Date of Previous Month
    By manali7120 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 07-30-2013, 02:54 PM
  2. Replies: 5
    Last Post: 10-04-2012, 07:06 AM
  3. [SOLVED] VBA to identify the current month and previous month based on system date
    By ravikumar00008 in forum Excel General
    Replies: 10
    Last Post: 07-26-2012, 10:04 AM
  4. [SOLVED] Date of the First day of the previous month
    By Hari in forum Excel General
    Replies: 5
    Last Post: 11-21-2011, 05:47 PM
  5. Display end of month date for previous month
    By erikwvb in forum Excel General
    Replies: 3
    Last Post: 06-20-2011, 01:22 PM

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