Data looks like this:
Aaa, Bbb, Ccc, Ddd, Eee, Fff
Aaa, Bbb, Ccc, Ddd, Eee
Aaa, Bbb, Ccc, Ddd
Aaa, Bbb, Ccc
Aaa, Bbb
Aaa
Data in rows is split by the ' , ' delimiter. I want to get the number of parts that each row is split to. Here is the figure:
So, in the 1st row the data is split to 6 parts by ',' delimiter. In the 2nd - 5 parts and so on.
What formula should I use is the column B?
I'd use this formula:
=LEN(A1)-LEN(SUBSTITUTE(A1,",",""))+1
In case you need 0, when the cell is empty (the above formula returns 1), use this:
=IF(A1="",0,LEN(A1)-LEN(SUBSTITUTE(A1,",",""))+1)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.