+ Reply to Thread
Results 1 to 10 of 10

Is there a more efficient way to show a subsequent month, but in number format?

  1. #1
    Registered User
    Join Date
    01-26-2022
    Location
    Wrightstown, New Jersey
    MS-Off Ver
    Windows 10 Enterprise, 1909
    Posts
    20

    Is there a more efficient way to show a subsequent month, but in number format?

    I'm looking for a more efficient way to show the subsequent month in a series. The month format I have to use is YYYYMM, but it has to be in number format. It has to do with the people who are entering the information. Explaining to them to enter a month as 10/2021, for example, is actually confusing to them, so I have them enter it as 202110. I use these numbers to calculate the difference between meter readings during a given period of time.
    The best solution I've come up with is a strange combination of SUMIFS, VLOOKUP, and a table of sequential months. I'm pretty sure there's a more efficient way, but just can't figure it out.

    Any thoughts?

    Thanks.
    Last edited by smhelgerson49; 04-20-2022 at 12:57 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,072

    Re: Is there a more efficient way to show a subsequent month, but in number format?

    Maybe this?

    =CHOOSE(--RIGHT(A1,2),2,3,4,5,6,7,8,9,10,11,12,1)

    Bear in mind you haven't actually told us exactly what outcome you want - this should return the NUMBER of the following month.
    Last edited by AliGW; 04-20-2022 at 12:03 PM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,072

    Re: Is there a more efficient way to show a subsequent month, but in number format?

    A different interpretation of what you want... and a different formula!!!


    =LEFT(A3,4)+INT((RIGHT(A3,2)+1)/12)&TEXT(MOD(RIGHT(A3,2)+1,12),"00")
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: Lá fhéile Pádraig sona dhaoibh

  4. #4
    Registered User
    Join Date
    01-26-2022
    Location
    Wrightstown, New Jersey
    MS-Off Ver
    Windows 10 Enterprise, 1909
    Posts
    20

    Re: Is there a more efficient way to show a subsequent month, but in number format?

    That works pretty slick, actually. Took me a moment to figure out what you did there.
    Is there a way that I can have this date format show up if I select a month from a drop down? In other words, if I select "JUN" from a drop down, and "2022" from another drop down, it would return 202206, then I could use your formula for the subsequent month of 202207.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,072

    Re: Is there a more efficient way to show a subsequent month, but in number format?

    Who are you talking to?

  6. #6
    Registered User
    Join Date
    01-26-2022
    Location
    Wrightstown, New Jersey
    MS-Off Ver
    Windows 10 Enterprise, 1909
    Posts
    20

    Re: Is there a more efficient way to show a subsequent month, but in number format?

    Quote Originally Posted by Glenn Kennedy View Post
    Who are you talking to?
    That was for you, Mr. Kennedy...
    Sorry...still learning this forum etiquette.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,072

    Re: Is there a more efficient way to show a subsequent month, but in number format?

    If it was me...

    formula to generate "entered month" becomes:

    =IF(OR(A3="",B3=""),"",A3&TEXT(MONTH(1&B3),"00"))

    see file for context.

    In any event, please make it clear WHO you are replying to...
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-26-2022
    Location
    Wrightstown, New Jersey
    MS-Off Ver
    Windows 10 Enterprise, 1909
    Posts
    20

    Re: Is there a more efficient way to show a subsequent month, but in number format?

    Quote Originally Posted by AliGW View Post
    Maybe this?

    =CHOOSE(--RIGHT(A1,2),2,3,4,5,6,7,8,9,10,11,12,1)

    Bear in mind you haven't actually told us exactly what outcome you want - this should return the NUMBER of the following month.
    Good point! Thank you for always helping me improve my posts!

    More specifically, I need to have a drop down list of short months (JAN, FEB, MAR...) and an associated year from a drop down (2019, 2020, etc...) then return that month in a YYYYMM format (so JUN 2023 selected from the drop down lists would give me 202306, but in a number format rather than date. Then, I'd need the subsequent month (202307) also in number format. The reason I need them in number format is that the folks I have doing meter readings are military and think in the YYYYMM format when they enter dates. All the data I have going back to 2010 is in that format.

    Does that clarify?

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,072

    Re: Is there a more efficient way to show a subsequent month, but in number format?

    This is more logical:

    =IF(A3="","",TEXT(DATE(A3,MONTH(1&B3)+1,1),"yyyymm")+0)
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    01-26-2022
    Location
    Wrightstown, New Jersey
    MS-Off Ver
    Windows 10 Enterprise, 1909
    Posts
    20

    Re: Is there a more efficient way to show a subsequent month, but in number format?

    Quote Originally Posted by Glenn Kennedy View Post
    If it was me...

    formula to generate "entered month" becomes:

    =IF(OR(A3="",B3=""),"",A3&TEXT(MONTH(1&B3),"00"))

    see file for context.

    In any event, please make it clear WHO you are replying to...
    If Marvel ever makes a movie about Excel Superheros...you'll be the Iron Man of that story arch. This is amazing.

+ 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. Replies: 2
    Last Post: 09-27-2019, 03:15 PM
  2. Replies: 3
    Last Post: 07-02-2019, 08:55 AM
  3. Show Error when a cell with number format change to date format
    By delroba in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-08-2015, 02:57 AM
  4. Copy and Paste dates then chnage the format to show the month
    By spiritbarbie in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-10-2014, 12:18 PM
  5. Replies: 1
    Last Post: 05-18-2006, 11:45 PM
  6. [SOLVED] show month number as month name in Excel?
    By Phil Hart in forum Excel General
    Replies: 3
    Last Post: 06-20-2005, 02:05 PM
  7. Date Format - converting number of month to name of month
    By Merlinwb in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 04-12-2005, 11:55 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