+ Reply to Thread
Results 1 to 11 of 11

Extract month from a number

  1. #1
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Extract month from a number

    my financial year start in Oct being period 1 and Ends in sept being period 12


    I would like to extract the month from the period number and also include the year. numbers 1 to 3 would be for the prior year for eg 1 would be Oct 2017 and 4 for eg would be January 2018


    I have tried to use the choose formula, but it returns 10


    Please Login or Register  to view this content.


    your assistance in resolving this is most appreciated

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,175

    Re: Extract month from a number

    2 optional:

    1.=TEXT('Pivot Table'!B2+93,"mmm ")&TEXT('Pivot Table'!B2,"yyyy") result -> Jan 2017


    2.=TEXT('Pivot Table'!B3+93,"m/")&TEXT('Pivot Table'!B3,"yyyy") result -> 1/2017

  3. #3
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,277

    Re: Extract month from a number

    For more clarity plz upload sample file with required result before & after.


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  4. #4
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Extract month from a number

    Thanks Phuocam


    Your formula works perfectly

  5. #5
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Extract month from a number

    Hi Avk


    thanks for your reply. would like to see if there is a way to use the choose formula , although Phuocam kindly provided me with a solution that works using an alternative formula

    See attached sample data. The Choose Formula which I tried to set up is on on sheet2
    Attached Files Attached Files

  6. #6
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,277

    Re: Extract month from a number

    let clarify : If period mentioned in summary 8 then what result required in sheet2
    give us 3-4 examples.

  7. #7
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Extract month from a number

    Thanks for your reply

    Start period is Oct

    1 = Oct, = 2 Nov 3 = Dec , 4= Jan etc


    In my sample Data 8 must result in May + Current year i.e May 2018, if 1, 2 or 3 must be the month + previous year for eg if 1 in in cell b2 on summary sheet, the formula on sheet2 must result in Oct 2017


    Your assistance in this regard is most appreciated

  8. #8
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,175

    Re: Extract month from a number

    =CHOOSE(MONTH('Pivot Table'!B2),"Oct ","Nov ","Dec ","Jan ","Feb ","Mar ","Ap r","May ","Jun ","Jul ","Aug ","Sep ")&YEAR('Pivot Table'!B2)

  9. #9
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Extract month from a number

    Thanks Phuocam


    for the time being I have excluded the year, but the month does not change on Sheet 2 A1 when I enter the number in B2 in Sheet Pivot Table


    Kindly check & amend
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    514

    Re: Extract month from a number

    Actually, you don't need the MONTH() in the formula:

    =CHOOSE('Pivot Table'!B2,"Oct ","Nov ","Dec ","Jan ","Feb ","Mar ","Apr ","May ","Jun ","Jul ","Aug ","Sep ")

    You can also try this shorter one:

    =TEXT((MOD('Pivot Table'!B2+8,12)+1)*28,"mmm ")

  11. #11
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Extract month from a number

    thanks for your help root.

    The formula extracts the months perfectly

+ 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] Month Function When Nested inside Text returns incorrect Month Serial Number
    By ibuhary in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-06-2018, 04:12 AM
  2. [SOLVED] Need to split 240 rows into an equal number, but that number may change month to month
    By taylorsm in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-17-2016, 04:15 PM
  3. [SOLVED] Extract last day of month from text month
    By BRISBANEBOB in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-05-2016, 07:36 PM
  4. Replies: 3
    Last Post: 07-14-2015, 12:26 PM
  5. Count number of networkdays for each month in a multi month period
    By dreddster in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-10-2013, 11:12 AM
  6. Changing number of days in a month based on month chosen from a dropdown list.
    By st_judeu@yahoo.com in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-08-2013, 02:26 PM
  7. How to extract month number from month name
    By PM in forum Excel General
    Replies: 2
    Last Post: 01-19-2005, 12:06 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