hELLoELL
V2EX  ›  问与答

excel trim函数的问题

  •  
  •   hELLoELL · Nov 9, 2012 · 4226 views
    This topic created in 4961 days ago, the information mentioned may be changed or developed.
    http://office.microsoft.com/zh-cn/excel-help/HA010102339.aspx#BMcount_the_number_of_words_in_a_cell

    这个例子中,A1:D4单元格中文字数明显超过37了。而且貌似TRIM函数本身对中文支持就是bug?

    ----------------
    如何统计单元格内的字数(中文)
    一开始我用 len
    但 如此单元格字与字中间有空格,空格也被确认为一个字。(好苦恼)
    于是使用 上述 网页中的示范例子,发现统计英文无误,无奈中文就是出错。包括网页上那个例子的字数统计也是个错误。

    感谢。
    1 replies    1970-01-01 08:00:00 +08:00
    crcw
        1
    crcw  
       Nov 26, 2012
    其实例子中是中文词组的个数,应该是16,37也是错误的。
    你是想要中文字符的字数嘛?
    如果是这样子的话,A1单元格如下:
    A
    1 过有 意义的一天!

    =LEN(A1)-(LENB(WIDECHAR(A1))-LENB(ASC(A1)))

    如果包括标点符号的话,
    =LEN(SUBSTITUTE(A1, " ", ""))
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5377 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 516ms · UTC 07:12 · PVG 15:12 · LAX 00:12 · JFK 03:12
    ♥ Do have faith in what you're doing.