简体   繁体   English

获取Excel中单元格的格式化值

[英]Get Formatted Value of Cell in Excel

How do you get the formatted value of a cell when using =CONCATENATE(E1, " - " , D1) ?使用=CONCATENATE(E1, " - " , D1)时如何获取单元格的格式化值?

E1 = 08/21/2014 8:00 PM EST (Formatted value = 08/21)

D1 = Task Item 1

Wanted output: = 08/21 - Task Item 1想要的输出:= 08/21 - Task Item 1

Use the TEXT() function:使用TEXT()函数:
TEXT(value, format_text)
So if the value is 23.5 and you pass =TEXT(A1, "$0.00") it will return $23.50因此,如果值为 23.5 并且您通过=TEXT(A1, "$0.00")它将返回$23.50
Source: http://office.microsoft.com/en-us/excel-help/text-function-HP010062580.aspx资料来源:http: //office.microsoft.com/en-us/excel-help/text-function-HP010062580.aspx

Building on @mmmmmpie answer,基于@mmmmmpie 答案,

I would go one further an argue that =TEXT(E1,CELL("format",E1)) is the better solution我会进一步争论=TEXT(E1,CELL("format",E1))是更好的解决方案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM