Find and remove duplicates: Difference between revisions
Jump to navigation
Jump to search
→Find and remove duplicates in Google Spreadsheet
| Line 127: | Line 127: | ||
* [https://sheetaki.com/remove-duplicates-from-comma-delimited-strings-in-google-sheets/ Remove Duplicates from Comma-Delimited Strings in Google Sheets - Sheetaki] | * [https://sheetaki.com/remove-duplicates-from-comma-delimited-strings-in-google-sheets/ Remove Duplicates from Comma-Delimited Strings in Google Sheets - Sheetaki] | ||
Initial contents of cell A2 which its separator is {{kbd | key=<nowiki>", "</nowiki>}} (a comma followed by a space): | Initial contents of cell A2 which its separator is comma or whitespace. The second parameter of SPLIT function is {{kbd | key=<nowiki>", "</nowiki>}} (a comma followed by a space): | ||
<pre> | <pre> | ||
apple, banana, apple | apple, banana, apple | ||
| Line 134: | Line 134: | ||
To remove duplicates from Cell A2, use the following formula: ((learn more about the UNIQUE function from Google Help<ref>[https://support.google.com/docs/answer/10522653?hl=zh-Hant UNIQUE 函式 - Google 文件編輯器說明]</ref> or Microsoft support<ref>[https://support.microsoft.com/zh-tw/office/unique-%E5%87%BD%E6%95%B8-c5ab87fd-30a3-4ce9-9d1a-40204fb85e1e UNIQUE 函數 - Microsoft 支援服務]</ref>) | To remove duplicates from Cell A2, use the following formula: ((learn more about the UNIQUE function from Google Help<ref>[https://support.google.com/docs/answer/10522653?hl=zh-Hant UNIQUE 函式 - Google 文件編輯器說明]</ref> or Microsoft support<ref>[https://support.microsoft.com/zh-tw/office/unique-%E5%87%BD%E6%95%B8-c5ab87fd-30a3-4ce9-9d1a-40204fb85e1e UNIQUE 函數 - Microsoft 支援服務]</ref>) | ||
<pre> | <pre> | ||
If cell A2's content is separated by a comma or whitespace: | |||
= JOIN(", ",UNIQUE(TRANSPOSE(SPLIT(A2,", ")))) | = JOIN(", ",UNIQUE(TRANSPOSE(SPLIT(A2,", ")))) | ||
If cell A2's content is separated solely by a comma: | |||
= JOIN(", ", UNIQUE(TRANSPOSE(ARRAYFORMULA(TRIM(SPLIT(A2, ",")))))) | |||
</pre> | </pre> | ||