Categorical data into numeric in excel I have a large dataset and I would like to convert these categorical data into numeric in binary form to perform k means clustering in R. However, I get an error in value. This is the formula that I have entered into the excel sheet: =LEFT(B2,FIND("  ",B2,1)-1).

This is my dataset.
Why don't you import the data into R and use some built-in function for encoding? createDummyFeatures from mlr package is a function, which can do one-hot encoding of categorical variables.

https://www.rdocumentation.org/packages/mlr/versions/2.13/topics/createDummyFeatures