## Count unique and duplicate numbers in a closed workbook

*Article updated on March 13, 2018*

Here is a picture of the closed workbook. There can´t be any blank cells or text values in your range.

As you can see, there are five unique distinct values (1, 2, 3, 5 and 6) and one duplicate value (3).

### How to count unique and duplicate numbers from a closed workbook

**Formula in B1:**

Don´t forget to change path to your closed workbbook.

**Formula in B2:**

Don´t forget to change path to your closed workbbook

### Evaluate formula

If I try to evaluate formula I get som strange results. A lot of #ref errors but the final result is correct.

### Functions in this article:

**IF(**logical_test;[value_if:true];[value_if_false]**)
**Checks whether a condition is met, and returns one value if TRUE, and another value if FALSE

**SUM(**number1,[number2],**)
**Adds all the numbers in a range of cells

**FREQUENCY**(data_array, bins_array)*
*Calculates how often values occur within a range of values and then returns a vertical array of numbers having one more element than Bins_array

*.*

Count how many numbers between a specific value occurring multiple times

jeyner asks: I need to count in a list the interval between the same value. Example list, 1-2-3-1-4-5-1-6-7-8-9-7-8-1 So the […]### Leave a Reply

**How to add a formula to your comment:**

<code>your formula</code>

Remember to convert less than and larger than signs to html character entities before you post your comment.

**How to add VBA code to your comment:**

[vb 1="vbnet" language=","]

VBA code

[/vb]

**How to add a picture to your comment:**

Upload picture to postimage.org

Add picture link to comment.

**Contact Oscar**

You can contact me through this webpage

## Share this article