Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试计算以下字符串中的名称:
约翰/比尔/罗伯特/爱德华
我需要知道内置公式来计算名称。根据上面的例子,我应该得到 4 作为结果。
也许计算斜线并添加 1 - 为单个单元格的此公式提供空白
=IF(A1="",0,LEN(A1)-LEN(SUBSTITUTE(A1,"/",""))+1)
如果您想跨范围计数,请使用此版本
=SUMPRODUCT((A1:A10<>"")+0,LEN(A1:A10)-LEN(SUBSTITUTE(A1:A10,"/",""))+1)