To keep the last occurrence, we will flip the data as earlier and use it as the range in SORTN.įurther, we may require to extract the ‘selected’ columns (A2:A6 and B2:B6) from flipped data using CHOOSECOLS to combine. Two-Column Formula (First Occurrences): =sortn(A2:C6,5,2,A2:A6&B2:B6,FALSE) Since we have two columns here, join them using the ampersand. We want to remove duplicates based on two selected columns, and they are A2:A6 (authors) and B2:B6 (book titles).Įarlier, we used A2:A6 as the sort_column. It’s simple if you have followed the above examples with patience. Removing duplicate rows based on selected two or more columns is not rocket science in Google Sheets. Removing Duplicate Rows Based on Selected Two Columns So the SORTN range will be chooserows(A2:B6,sequence(rows(A2:A6),1,-1,-1)). We can use the CHOOSEROWS function for that. We require to flip the data before applying the SORTN. ![]() What will we do if we want to keep the last occurrence of the row? Here we can also use the column index number, which is #1 here. It’s the column that decides the duplicates. Usually, experts use 9^9, an arbitrarily large number, because of unsure about the number of rows after removing duplicates based on the selected column. It’s the total number of rows in the range. Single-Column Formula (First Occurrences): =sortn(A2:B6,5,2,A2:A6,FALSE) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |