0% found this document useful (0 votes)
49 views4 pages

Explanation DuplicateRemovalFormula

This document explains different array formulas for extracting distinct values from a list. It breaks down the core parts of the basic DISTINCT VALUE formula which uses COUNTIF, MATCH, and INDEX functions. It also summarizes more advanced formulas for unique values, distinct text values ignoring numbers, and case sensitive distinct values which incorporate additional functions like IF, ISTEXT, EXACT, and FREQUENCY.

Uploaded by

Naveen Kr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views4 pages

Explanation DuplicateRemovalFormula

This document explains different array formulas for extracting distinct values from a list. It breaks down the core parts of the basic DISTINCT VALUE formula which uses COUNTIF, MATCH, and INDEX functions. It also summarizes more advanced formulas for unique values, distinct text values ignoring numbers, and case sensitive distinct values which incorporate additional functions like IF, ISTEXT, EXACT, and FREQUENCY.

Uploaded by

Naveen Kr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

For our in-depth analysis, let's use the array formula that extracts a list of distinct values.

All
other formulas are variations of this basic one:

DISTINCT VALUE formula

INDEX(Names_Distinct, MATCH(0, COUNTIF($F$3:F11, Names_Distinct), 0)), "")

Let's break down the core part of our distinct formula:

1. COUNTIF(range, criteria) returns the number of cells within a range that meet a specified
condition.

In this example, COUNTIF($F$3:F3, Names_Distinct) returns an array of 1's and 0's based on
whether any of the values of the source list (Names_Distinct) appears somewhere in the
distinct list ($F$3:F3). If the value is found, the formula returns 1, otherwise - 0.

In particular, in cell F4, COUNTIF($F$3:F3, Names_Distinct) becomes:


COUNTIF("Distinct", {"Ronnie"; ..;12})

and returns: {0;0;0;0;0;0;0;0;0}

because none of the items of the source list (criteria) appears in the range where the
function looks for a match. In this case, range ($F$3:F3) consists of a single item - "Distinct".

2. MATCH(lookup_value, lookup_array, [match_type]) returns the relative position of the


lookup value in the array.

In this example, the lookup_value is 0, and consequently:

MATCH(0, COUNTIF($F$3:F11, Names_Distinct) turns into: MATCH(0, {0;0;0;0;0;0;0;0;0},0)

and returns 1

because our MATCH function gets the first value that is exactly equal to the lookup value
(lookup value is 0).

3. INDEX(array, row_num, [column_num]) returns a value in an array based on the specified


row and (optionally) column numbers.

In this example, INDEX(Names_Distinct, 1) becomes:


INDEX({"Ronnie"; ; 12}, 1)

and returns "Ronnie".


4. When the formula is copied down the column, the distinct list ($F$3:F3) expands because
the second cell reference (B1) is a relative reference that changes according to the relative
position of the cell where the formula moves.

So, when copied to cell F5, COUNTIF($F$3:F3, Names_Distinct) changes to

COUNTIF($F$3:F4, Names_Distinct) and becomes:

COUNTIF({"Distinct";"Ronnie"}, {"Ronnie"; ..;12 }), 0)), "")

and returns: {1;0;0;0;0;0;0;0;0}

because one "Ronnie" is found in range $F$3:F4.

Then, MATCH(0,{1;0;0;0;0;0;0;0;0},0) returns 2, because 2 is the relative position of the first


0 in the array.

5. And finally, INDEX(Names_Distinct, 2) returns the value from the 2nd row, which is "David".

UNIQUE VALUE formula

It contains one more COUNTIF function that excludes from the unique list all items that appear
in the source list more than once: COUNTIF($B$4:$B$12, $B$4:$B$12)<>1

DISTINCT VALUE IGNORING BLANKS formula


An IF function that prevents blank cells from being added to the distinct list
IF($E$4:$E$15="",1,0)

DISTINCT TEXT VALUE IGNORING NUMBERS formula


the ISTEXT function is used to check whether a value is text, and the IF function to dismiss all
other value types, including blank cells: IF(ISTEXT($A$2:$A$13)=FALSE,1,0).

CASE SENSITIVE DISTINCT VALUES formula

IFERROR(INDEX($J$4:$J$12, MATCH(0, FREQUENCY(IF(EXACT($J$4:$J$12,


TRANSPOSE($K$3:K3)), MATCH(ROW($J$4:$J$12), ROW($J$4:$J$12)), ""),
MATCH(ROW($J$4:$J$12), ROW($J$4:$J$12))), 0)), "")

Lets break down the core parts of our formula


1. TRANSPOSE($K$3:K3). TRNSPOSE is a function that converts a row to column and a column
to row.
In this example it returns { Case-sensitive distinct values} in cell k4.

When the formula is copied to the subsequent cells, it returns { Case-sensitive distinct
valuesuser1} ..

2. EXACT($J$4:$J$12, TRANSPOSE($K$3:K3). EXACT is a function that returns TRUE or FALSE if


an exact match for a lookup value in found in an array.

In this example it evaluates to EXACT({user1,..user2},{Case-sensitive distinct values})


and hence {FALSE,FALSE,FALSE}

3. ROW($j$4:$j$12). ROW is a function that returns the row number of a reference.

In this example, which is an array function, it evaluates to {4,5,6,7,8,9,10,11,12}

4. MATCH(ROW($J$4:J12), ROW($J$4:$J$12)). Match returns relative position of an element


in an array
In this example MATCH evaluates to MATCH({4,5,6,7,8,9,10,11,12},({4,5,6,7,8,9,10,11,12})
and hence returns {1,2,3,4,5,6,7,8,9}

Since the cell J12 in the first ROW is relative, as the formula is copied down, the reference of
the array $j$4:j12 changes to 5,6 and hence the returns 2,3,4, .in the subsequent cells of
column k.

5. IF(EXACT($J$4:$J$12, TRANSPOSE($K$3:K3)), MATCH(ROW($J$4:J12), ROW($J$4:$J$12)),


"")

Here, the IF function evaluates to if({FALSE,FALSE,FALSE}},{1,2,3,4,5,6,7,8,9}) and


hence returns {,,,,,,,,}

6. MATCH(ROW($J$4:J12), ROW($J$4:$J$12)) returns {1,2,3,4,5,6,7,8,9}

7. FREQUENCY(IF(EXACT($J$4:$J$12, TRANSPOSE($K$3:K3)), MATCH(ROW($J$4:J12),


ROW($J$4:$J$12)), ""), MATCH(ROW($J$4:$J$12), ROW($J$4:$J$12))). FREQUENCY is a
function that returns the number of times different elements of a bin array occurs in a given
array.

Here , it evaluates to FREQUENCY){,.,},{1,2,3..,9}) and hence returns


{0,0,0,0,0,0,0,0,0}

8. MATCH(0, FREQUENCY(IF(EXACT($J$4:$J$12, TRANSPOSE($K$3:K3)),


MATCH(ROW($J$4:J12), ROW($J$4:$J$12)), ""), MATCH(ROW($J$4:$J$12),
ROW($J$4:$J$12))), 0)
evaluates to MATCH(0,{0,0,0,0,0,0,0,0,0},0) and returns 1
9. INDEX($J$4:$J$12, MATCH(0, FREQUENCY(IF(EXACT($J$4:$J$12, TRANSPOSE($K$3:K3)),
MATCH(ROW($J$4:J12), ROW($J$4:$J$12)), ""), MATCH(ROW($J$4:$J$12),
ROW($J$4:$J$12))), 0))
evaluates to INDEX({user1,,user2},1) and hence returns {user1}

You might also like