Excel号码格式:什么是“[$ - 409]”? [英] Excel Number Format: What is "[$-409]"?

查看:410
本文介绍了Excel号码格式:什么是“[$ - 409]”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我自动化excel,使用宏系统作为我应该通过自动化做的指南。当我将列格式化为日期时,宏会生成一个 NumberFormat ,用于列:

  [$  -  409] m / d / yy h:mm AM / PM; @ 


$ b $我试图破译这是什么意思。我收集从谷歌搜索,方括号中的值是 条件,如果条件:

  $  -  409 

满足,那么它将使用 NumberFormat

  m / d / yy h:mm AM / PM 

如果没有,它使用 NumberFormat

  @ 

我发现引用的数字格式是@是文本占位符



所以我的问题是:


  1. 有条件的 $ - 409 测试?是否比较一些与 -409 (即负四百九十)的某些东西,如果是,那么与它进行比较的美元符号是什么?


  2. 如果条件失败,并且它采用文本占位符at-sign,它显示为什么? / p>



解决方案

澄清别人说的话:



[$ -409]是一个区域设置代码,以十六进制形式给出。使用某个区域代码预定义日期可以确定使用各种日期时间格式代码时显示的日期。例如使用日期


1973年11月28日11:28:13 AM


作为下表的示例:

 格式代码409(英文美国) 804(中华人民共和国)
=========== ========================= === ==============
m 11 11
mm 11 11
mmm Nov十一月
mmmm十一月一
d 27 27
dd 27 27
ddd星期一二
dddd星期一星期二$ b $ 73 73
yy 73 73
yyy 1973 1973
yyyy 1973 1973
AM / PM AM午餐

所以到最后,具有两个不同语言环境标识符的相同格式代码会产生不同的结果: p>

  [$  -  409] mmmm dd yyyy h:mm AM / PM 
1973年11月27日11:28


[$ -804] mmmm dd yyyy h:mm AM / PM
十一月27 1973 11:28上午

由于找到一个区域代码列表就像拔牙,这里有一些参考资料:



语言标识符常量和字符串(主要来源)



Windows区域代码按区域设置排序



按区域设置排序的Windows区域代码


i'm automating excel, using the macro system as a guide to what i should do through automation. When i format a column as a date, the macro generated a NumberFormat for the column to be:

[$-409]m/d/yy h:mm AM/PM;@

i'm trying to decipher what this really means. i gather from googling, that the values in the square brackets are a "condition", and that if the condition:

$-409

is met, then it will use the NumberFormat

m/d/yy h:mm AM/PM

if not, it uses the NumberFormat

@

The references i find say that the number format "@" is a Text Placeholder

So my questions are:

  1. What is the conditional $-409 testing? Is it comparing something against -409 (i.e. negative four hundred and nine), and if so, what is the dollar sign it's comparing against?

  2. If the conditional fails, and it resorts to the Text Placeholder "at-sign", what does it show as?

解决方案

To clarify what others have said:

The [$-409] is a locale code, given in hexadecimal. Prefixing a date with a certain locale code determines what is shown when you use the various date time format codes. For example using the date

November 28, 1973 11:28:13 AM

as an example for the following table:

Format Code  409 (English United States)  804 (Chinese PRC)
===========  ===========================  =================
m            11                           11
mm           11                           11
mmm          Nov                          十一月
mmmm         November                     十一月
d            27                           27
dd           27                           27
ddd          Mon                          二
dddd         Monday                       星期二
y            73                           73
yy           73                           73
yyy          1973                         1973
yyyy         1973                         1973
AM/PM        AM                           上午

So in the end the same format code with two different locale identifiers, gives different results:

[$-409]mmmm dd yyyy  h:mm AM/PM
November 27 1973  11:28 AM


[$-804]mmmm dd yyyy  h:mm AM/PM
十一月 27 1973  11:28 上午

Since finding a list of locale codes is like pulling teeth, here are some references:

Language Identifier Constants and Strings (Primary source)

Windows Locale Codes Sorted by Locale

Windows Locale Codes Sorted by Locale

这篇关于Excel号码格式:什么是“[$ - 409]”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆