A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Use Excel’s built‑in tools for unique/duplicate handling instead of editing the UNIQUE array directly.
To hide duplicates (show only unique values):
- Select the column that contains the data.
- On the Data tab, in the Sort & Filter group, select Advanced.
- In Advanced Filter:
- Choose Filter the list, in‑place (to hide duplicates in the same column), or Copy to another location (to put the unique list somewhere else).
- Check Unique records only.
- If using Copy to another location, set Copy to to an empty cell.
- Select OK.
- If you chose Filter the list, in‑place, only unique values remain visible and duplicates are hidden.
- If you chose Copy to another location, the new range contains only unique values.
To count how many unique values there are:
- After using Advanced Filter to copy unique values to a new column (for example, B2:B45),
- In a blank cell below that list, enter:
This returns the number of unique values.=ROWS(B2:B45)
The error “you can’t change part of an array” appears because formulas like UNIQUE create dynamic arrays that cannot be partially edited. Use Advanced Filter instead when needing to manipulate or filter the resulting list.
References: