+ Reply to Thread
Results 1 to 12 of 12

date formatting is acting weird.

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    date formatting is acting weird.

    Hello. I created a formula that takes values from text and creates a column that says January 2011 (for example). The format button says date, but I can't change the formatting. Additionally, when I change it to numbers it still says January 2011. This causes problems for me when I'm doing a pivot table. Any thoughts?

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: date formatting is acting weird.

    That is because it is not a date, even though it looks like a date.. It is just a Text String..

    Try to get it to a proper date format..

    Let me know if you need help!
    Cheers!
    Deep Dave

  3. #3
    Valued Forum Contributor
    Join Date
    04-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, 2019, Office 365, Google Spreadhsheet
    Posts
    640

    Re: date formatting is acting weird.

    Hi Amma,

    You have taken values from a text in a cell which might formatted previously in format ("mmmm yyyy"). Just because of this, you are getting value getting displayed in Date format as January 2011.

    If this is not the case then please upload your file.
    Thanks,
    Anil Dhawan


    Click *Add Reputation to say "Thanks" and don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved) if you are satisfied.

    Don't stop when you are tired. STOP when you are done!

  4. #4
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: date formatting is acting weird.

    Here is an example. How do I get the value in yellow to be a date?
    Attached Files Attached Files

  5. #5
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: date formatting is acting weird.

    Here!

    Use this formula in Cell D2

    =DATE(B2,MONTH(1&C2),1)

    And Format Cells > Custom > yyyy mmmm

  6. #6
    Valued Forum Contributor
    Join Date
    04-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, 2019, Office 365, Google Spreadhsheet
    Posts
    640

    Re: date formatting is acting weird.

    Quote Originally Posted by NeedForExcel View Post
    Here!

    Use this formula in Cell D2

    =DATE(B2,MONTH(1&C2),1)

    And Format Cells > Custom > yyyy mmmm
    Just small addition so that she does not need to go for change in date format manually . =TEXT(DATE(B2,MONTH(1&C2),1),"YYYY MMMM").

    Hope this will work for you Amma

  7. #7
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: date formatting is acting weird.

    Oh, and why did I need to use the month(1&C2)? What does that do?

  8. #8
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: date formatting is acting weird.

    Quote Originally Posted by ammartino44 View Post
    Oh, and why did I need to use the month(1&C2)? What does that do?
    Hi,

    That is because, =MONTH("January") wont work, as the Month function does not accept a Text sting like "January" as an argument.

    Hence I used =MONTH(1&"January") as a workaround to return the Month serial number for the Month argument of the Date function..

  9. #9
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: date formatting is acting weird.

    Awesome. Thank you both. Just a question: With my formula, why don't the format buttons work? It says date even though it isn't.

  10. #10
    Valued Forum Contributor
    Join Date
    04-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, 2019, Office 365, Google Spreadhsheet
    Posts
    640

    Re: date formatting is acting weird.

    Because it was string as mentioned above by @NeedForExcel. As you just taken a reference from a cell which was not in number format. So it was showing you the same you mentioned.

    Please take few seconds to mark this thread SOLVED and say thanks to the people who helped you by adding *Add Reputation

  11. #11
    Valued Forum Contributor
    Join Date
    04-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, 2019, Office 365, Google Spreadhsheet
    Posts
    640

    Re: date formatting is acting weird.

    as the month function can not read the Text String so it converting Text String to numbers of month.

  12. #12
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: date formatting is acting weird.

    Glad it helped!

+ 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. Excel acting weird
    By john2 in forum Excel General
    Replies: 3
    Last Post: 06-04-2007, 07:29 PM
  2. Excel Acting Weird!
    By samilees in forum Excel General
    Replies: 5
    Last Post: 01-09-2007, 08:52 AM
  3. VBE acting weird - help
    By dpenny in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-28-2006, 01:30 AM
  4. Undo Acting Weird
    By bw in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-08-2005, 10:05 AM
  5. [SOLVED] Cell is acting weird
    By LavaDude in forum Excel General
    Replies: 3
    Last Post: 03-17-2005, 11: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