Count number of values in a cell unless blank

后端 未结 2 697
北恋
北恋 2021-01-23 09:57

I have a cell that uses a drop-down list that allows for multiple selections. How do I count the number of selections?

I used this: =LEN(A2)-LEN(SUBSTITUTE(A2,\",\",\"\"

2条回答
  •  别那么骄傲
    2021-01-23 10:23

    If your selections do not have spaces then substitute commas for spaces, trim the result then count for spaces as above with commas.

    =LEN(trim(SUBSTITUTE(A2,","," ")))-LEN(SUBSTITUTE(trim(SUBSTITUTE(A2,","," "))," ",""))+sign(len(a2))
    

提交回复
热议问题