Hi is there a way to count elements in array like that (im using google sheets)
I tried googling but didnt find anyone having the same problem
CodePudding user response:
=counta(split(cellref,","))
will count the number of elements in the array (where cellref is location of your array to be split).
CodePudding user response:
You can use the SPLIT
function in Google Sheets to split the cell content into separate elements, and then use the LEN
function to count the number of elements in the split string.
Here's the formula you would use:
=LEN(SPLIT(A1; ",")) 1
or like this (depending on locale)
=LEN(SPLIT(A1, ",")) 1
CodePudding user response:
try:
=LEN(REGEXREPLACE(A1; "[^,]"; )) 1
for array:
=INDEX(IF(A1:A="";;LEN(REGEXREPLACE(A1:A; "[^,]"; )) 1))