What does bb or bbbb represent in an EN-US TEXT function or Custom Number format mask?

倖福魔咒の 提交于 2019-12-18 09:26:22

问题


On a EN-US regional system, what does B or b represent in a format mask? While it does nothing in VBA's Format function, both the TEXT function and Custom Number Formatting recognize b as a legal Number Format Code and return a number that I cannot determine the origin of.

To further confuse matters, larger numbers return different values when formatted with bbbb and while blocks of sequential numbers return the same value, there are transitions when they jump ahead a digit. I do know that Excel expects the format mask to be either bb or bbbb because if B or b is supplied as a custom number format Type: then it is corrected to bb and the same goes for BBB or bbb being corrected to bbbb.

  

If you look at the digit transitions in the above image then this must have something to do with calendar years and leap years. The transitions appear to generally be 365 between them except for every fourth which is 366. Is the 24 the number of leap years since 01-Jan-1900 according to the current system clock?

Might this be a format mask character for a non-Gregorian calendar system? I can find no documentation (official or otherwise) on the subject.


I've been told that this behavior is not exhibited on all systems. For me, this occurs in both XL2010 Pro Plus and XL2013 Pro Plus (both EN-US 64 bit Office on 64 bit EN-CA OS)


回答1:


bb and bbbb appear to be formatting codes for the Buddhist calendar year, which are in use in Thailand and are simply the Gregorian year plus 543. bbbb is 4 digits and bb is two digits, as for yyyy and yy.

Excel has a date representation which consists of the count of days beginning with Jan 1 1900 (except when it's Jan 1 1904). So 1 == Jan 1 1900, which is Jan 1 2443 Buddhist, and you're formatting the year, 2443.




回答2:


Buddhist Era date. It should be bb or bbb, I think.



来源:https://stackoverflow.com/questions/32804557/what-does-bb-or-bbbb-represent-in-an-en-us-text-function-or-custom-number-format

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!