Excel TEXT() Formula Getting the Month returning “mmm”

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Excel TEXT() Formula Getting the Month returning “mmm”



I got a report in excel and I'm having some trouble with a Russian PC. The formula TEXT is being used to get the month name from a date but, in the Russian PC it's not working and not given an error.



The formula is =TEXT(D7, "mmm") and the result is "mmm".


=TEXT(D7, "mmm")


"mmm"



I also tried (The excel way to handle dates in different languages):



=TEXT(D7, "[$-409]mmm") and the result is "mmm".


=TEXT(D7, "[$-409]mmm")


"mmm"



I've tested different date functions and they all working. (Sum(), month(), changing data format, etc).


Sum()


month()



Version: Excel 365


Excel 365



As it works in my pc, does anyone have any idea what might be causing the error?




2 Answers
2



First - The mmm should be MMM.


mmm


MMM



Then, the fact that the PC is in Russian is a bit irrelevant. What matters is the installation language of Excel.



You may try the following


43319


A1


=TEXT(A1,"MMM")


M


Aug





If I copy ММ directly out of the RU-RU docs and test the character code, I come up with ascii 63 (unicode 1052). Not what I would expect from an EN-US M (ascii 77).
– Jeeped
Aug 7 at 16:18



ММ





@Jeeped - if you copy any of these words - =ТЕКСТ(СЕГОДНЯ();"ДД.ММ.ГГ") you would get 63. Guess you are using something like this - ?Asc(Range("A1")). stackoverflow.com/questions/25838639/…
– Vityata
Aug 7 at 16:21



=ТЕКСТ(СЕГОДНЯ();"ДД.ММ.ГГ")


?Asc(Range("A1"))





No, just CODE(...) and UNICODE(...) on the worksheet.
– Jeeped
Aug 7 at 16:22





@Jeeped - yeah, the built-in formulas are faster.
– Vityata
Aug 7 at 16:25





Sorry, for taking too long to answer. But it didn't work as well. I've tried to use the number format stead date, but the result is always the same "MMM".
– Inacius
Aug 14 at 11:17



I've found a way to fix it creating a new formula in VBA and it worked great.



Press Alt+F11 (to open the VBA editor) Then Click the menu item Insert > Module In the new VBA module, enter the following:


Public Function FMT$(ByVal Value, ByVal strFormat)
FMT = VBA.Format$(Value, strFormat)
End Function



To use this, simply type =FMT(A1, "MMM") instead of =TEXT(A1, "MMM").


=FMT(A1, "MMM")


=TEXT(A1, "MMM")



Credits to https://superuser.com/questions/730371/how-to-prevent-excel-to-use-the-os-regional-settings-for-date-patterns-in-formul






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS