Search code examples
regexgoogle-sheetssplituniquegoogle-sheets-formula

Extract a list of unique text characters/ emojis from a cell


I have a text in cell (A1) like this: āœŒšŸ˜‹šŸ‘…šŸ‘…ā˜ļøšŸ˜‰šŸŒšŸŖšŸ’§šŸ’§

I want to extract the unique emojis from this cell into separate cells: āœŒšŸ˜‹šŸ‘…ā˜ļøšŸ˜‰šŸŒšŸŖšŸ’§

Is this possible?


Solution

    • You want to put each character of āœŒšŸ˜‹šŸ‘…šŸ‘…ā˜ļøšŸ˜‰šŸŒšŸŖšŸ’§šŸ’§ to each cell by splitting using the built-in function of Google Spreadsheet.

    Sample formula:

    =SPLIT(REGEXREPLACE(A1,"(.)","$1@"),"@")
    
    • āœŒšŸ˜‹šŸ‘…šŸ‘…ā˜ļøšŸ˜‰šŸŒšŸŖšŸ’§šŸ’§ is put in a cell "A1".
    • Using REGEXREPLACE, @ is put to between each character like āœŒ@šŸ˜‹@šŸ‘…@šŸ‘…@ā˜@ļø@šŸ˜‰@šŸŒ@šŸŖ@šŸ’§@šŸ’§@.
    • Using SPLIT, the value is splitted with @.

    Result:

    enter image description here

    Note:

    • In your question, the value of ļø which cannot be displayed is included. It's \ufe0f. So "G1" can be seen like no value. But the value is existing. So please be careful this. If you want to remove the value, you can use āœŒšŸ˜‹šŸ‘…šŸ‘…ā˜šŸ˜‰šŸŒšŸŖšŸ’§šŸ’§.

    References:

    Added:

    From marikamitsos's comment, I could notice that my understanding was not correct. So the final result is as follows. This is from marikamitsos.

    =TRANSPOSE(UNIQUE(TRANSPOSE(SPLIT(REGEXREPLACE(A1,"(.)","$1@"),"@"))))