+ Reply to Thread
Results 1 to 5 of 5

text number convert to month

  1. #1
    Forum Contributor
    Join Date
    03-05-2015
    Location
    Cambodia
    MS-Off Ver
    2016
    Posts
    118

    text number convert to month

    Dear All,

    I try many way to convert below text to month "mmm" but it doesn't work.

    I use Datevalue, text(cell,"mmm")

    Here is the number i want to convert it in to month name "Apr" and then sum the value of each month.
    I have attached excel file for more detail:

    15.04.2019 22.04.2019 29.04.2019 06.05.2019 13.05.2019 20.05.2019 27.05.2019 03.06.2019 10.06.2019 17.06.2019 24.06.2019 01.07.2019 08.07.2019 15.07.2019


    Thanks & looking to hear from your help.
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: text number convert to month

    To get the month try this.

    =TEXT(DATEVALUE(SUBSTITUTE(B2,".","/")), "mmm")

    For the sum you could try something like this:

    =SUMPRODUCT(B3:T3,--(MID($B$2:$T$2,4,2)=TEXT(DATEVALUE("1 "&B$6), "mm")))
    Last edited by Norie; 04-19-2019 at 08:09 AM.
    If posting code please use code tags, see here.

  3. #3
    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
    80,647

    Re: text number convert to month

    These values are not dates - they are just text. Enter proper dates into those cells.
    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.

  4. #4
    Forum Contributor
    Join Date
    03-05-2015
    Location
    Cambodia
    MS-Off Ver
    2016
    Posts
    118

    Re: text number convert to month

    Hi,

    I try datevalue as you mention but it now work its show "#VALUE!"

    Can you help to test it again.

    Thanks,
    Leakhna

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: text number convert to month

    If you are using dates, tt is almost ALWAYS better to stick with the same format thoughout - and always easier if you stay with REAL dates.
    15.04.2019 is not a date, it is text that just looks like a date.
    Apr is also not a date (to excel), it is just 3 random letters

    If you really must used mixed dates like this, the above SHOULD work, but he is a hack that does what you want, without the need to change anything.

    B7=SUMIF($B$2:$T$2,"*."&TEXT(MATCH(B6,{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"},0),"0#")&".*",$B3:$T3)
    copied down and across as needed
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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: 3
    Last Post: 10-29-2015, 02:33 AM
  2. [SOLVED] how to convert text number to year month and date
    By leakhna in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-03-2015, 05:19 AM
  3. how to convert the month in a date to the text word for that month
    By sthshrmags in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-05-2014, 03:15 PM
  4. [SOLVED] Excel 2007 : How to convert month number to month name
    By FDibbins in forum Excel General
    Replies: 14
    Last Post: 04-08-2014, 12:42 AM
  5. [SOLVED] Function or formula to convert "text" month to number of month?
    By Steve Vincent in forum Excel General
    Replies: 1
    Last Post: 02-06-2006, 05:35 PM
  6. [SOLVED] RE: Function or formula to convert "text" month to number of month?
    By Kevin Vaughn in forum Excel General
    Replies: 0
    Last Post: 02-04-2006, 12:50 PM
  7. Replies: 1
    Last Post: 02-04-2006, 12:19 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