Difference between the DISTINCT and UNIQUE functions:
Difference between the DISTINCT and UNIQUE functions:
Suppose we have a list of scores:
| Name | Score |
| --- | --- |
| John | 90 |
| Mary | 80 |
| John | 90 |
| David | 70 |
| Mary | 80 |
| Emma | 95 |
We want to analyze the scores using the DISTINCT and UNIQUE functions:
DISTINCT Function
=DISTINCT(B2:B7)
Result:
| Score |
| --- |
| 90 |
| 80 |
| 70 |
| 95 |
The DISTINCT function returns all the unique scores.
UNIQUE Function
=UNIQUE(B2:B7)
Result:
| Score |
| --- |
| 70 |
| 95 |
The UNIQUE function returns only the scores that appear only once.
In this example:
- The score 90 appears twice, so it's not included in the UNIQUE result.
- The score 80 appears twice, so it's not included in the UNIQUE result.
- The scores 70 and 95 appear only once, so they're included in the UNIQUE result.
This example shows the difference between the DISTINCT and UNIQUE functions:
- DISTINCT returns all unique values.
- UNIQUE returns only the values that appear only once.
Comments
Post a Comment