+ Reply to Thread
Results 1 to 11 of 11

Determine if month was last month

  1. #1
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Determine if month was last month

    Hi,

    I need a formula that checks to see if a date is within last month. I have a formula that works except when the current month is January.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If the current month is January (1) and it checks for previous month December (12) then this doesn't work.

    Any ideas?

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,396

    Re: Determine if month was last month

    Start with this and see if it gets you started. With reference date in A1
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    At my end with 1/3/2018 in A1 it returns 12.

    Does this help?
    Dave

  3. #3
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Determine if month was last month

    Quote Originally Posted by FlameRetired View Post
    At my end with 1/3/2018 in A1 it returns 12.
    I tried it and it returns 2

  4. #4
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Determine if month was last month

    Quote Originally Posted by FlameRetired View Post
    Start with this and see if it gets you started. With reference date in A1
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    At my end with 1/3/2018 in A1 it returns 12.

    Does this help?
    Thanks Dave,

    This is my working answer;

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,396

    Re: Determine if month was last month

    Quote Originally Posted by sandy666 View Post
    I tried it and it returns 2
    See what comes of being American? We "spin" counter clockwise, too. I asked an Aussie.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,396

    Re: Determine if month was last month

    kersplash you are welcome. Did you see sandy's comment? I forgot about regional settings.

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Determine if month was last month

    Dave, look here

    [I did it via PQ but to see result you don't need PQ]
    Attached Files Attached Files

  8. #8
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Determine if month was last month

    Quote Originally Posted by FlameRetired View Post
    kersplash you are welcome. Did you see sandy's comment? I forgot about regional settings.
    Yep, understood that you were using that weird date format.

  9. #9
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Determine if month was last month

    Sorry but these words "weird date format" made me LOL

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,396

    Re: Determine if month was last month

    Quote Originally Posted by sandy666 View Post
    Dave, look here

    [I did it via PQ but to see result you don't need PQ]
    Cool. Thanks sandy. I'm keeping it. Regional settings ignorance is one of the reasons I usually post a workbook and let OP's settings sort it out.

    Data processing in some countries must be real challenging where they use both formats. How does one tell the difference between Jan 3 or Mar 1 ... unless they write out the month name?

  11. #11
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Determine if month was last month

    If they input date manually it will be hard Especially if it will be date as text. But with Excel it will be automated I suppose.
    I was lookin' for solution to read date with regional settings (country) but no luck. Maybe typing name of month is a solution?

    btw. thanks for r

+ 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. [SOLVED] Calculation of days per month for dates beginning in one month and ending in another month
    By Fahrettin in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-07-2015, 04:52 PM
  2. How to determine whether month follows or precedes a set month?
    By tinytutu in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-13-2014, 01:15 AM
  3. [SOLVED] Determine work days in current month or next month based on day of the month
    By sbrnard in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-29-2014, 05:14 PM
  4. [SOLVED] Auto instert Month names for This month, Last month and Next month
    By hemal89 in forum Word Programming / VBA / Macros
    Replies: 4
    Last Post: 12-10-2013, 12:01 PM
  5. Determine Last working day of Month
    By Nigel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-22-2012, 04:09 AM
  6. Replies: 4
    Last Post: 08-09-2006, 09:59 AM
  7. Determine begin month date from month end date.
    By mikeburg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-13-2006, 04:42 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