How to count comma separated values in a single cell in Excel?
If cell content is separated by comma in a single cell, such as “A1, A2, A3, A4, A5”, and you want to count the total number of comma separated values in this cell, what can you do? In this case, the total comma separated values should be 5. In this article, we will show you two methods of counting comma separated values in a single cell in Excel.
Excel Productivity Tools
Office Tab: Bring powerful tabs to Office (include Excel), just like Chrome, Safari, Firefox and Internet Explorer. Save you half the time, and reduce thousands of mouse clicks for you. 30-day Unlimited Free Trial
Kutools for Excel: Save 70% of your time and solve 80% Excel problems for you. 300+ advanced features designed for 1500+ work scenario, make Excel much easy and increase productivity immediately. 60-day Unlimited Free Trial
You can count the number of items which are separated by comma in a single cell with following formula.
1. Select a blank cell which is adjacent to the cell you want to count comma separated values.
2. Type formula =LEN(TRIM(A1))-LEN(SUBSTITUTE(TRIM(A1),",",""))+1 into the formula bar, and then press the Enter key.
You can see the total number of comma separated values is populated in the selected cell. See screenshot:
3. Drag the Fill Handle down to the cells you want to cover this formula to get the results.
With the Split Cells utility of Kutools for Excel, you can easily separate a comma separated value cell with comma, and then get the number of comma separated values in the Status Bar. Please do as follows.
1. Select the cell you want to count comma separated values, and click Kutools > Text > Split Cells. See screenshot:
2. In the Split Cells dialog box, select the Other option, enter a comma to the following box, and then click the OK button.
3. In the popping up Split Cells dialog box, select a blank cell for locating the split values, then click the OK button.
Then the specified cell is split into multiple cells by comma, now you can get the total number of comma separated values in the Status Bar. See screenshot:
Note: You can split multiple cells by commas at the same time by selecting all of these cells firstly and then applying this utility.
- How to count the number of words in a cell or a range cells in Excel?
- How to convert birthdate to age quickly in Excel?
- How to count unique values excluding duplicates in Excel?
Excel Productivity Tools
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
To post as a guest, your comment is unpublished.
To post as a guest, your comment is unpublished.· 2 years agoi have comma separated values in cells like
I want to add the contents of the two cells without repeating the value and also want to get the common value of two cells
expected result = 1,2,3,4,5,6,7,8
i am not getting the exact formula in microsoft excel 2013
Kindly help me
To post as a guest, your comment is unpublished.· 3 years agoWhat if some of the cells underneath are blank? When using the fill handle on the rest of the cells it's coming up with 1 as the total.
To post as a guest, your comment is unpublished.· 2 years agoHello James55, don't know if you ever got an answer but in case you need one. Use an IF statement to check if the cell is blank and then print a "0" or null "" whichever you like.