## Find max unique value from a range that have duplicate numbers and blanks

**Array formula in cell D11:**

**Array formula in cell D12:**

**Formula in cell D15:**

**Formula in cell D16:**

**Array formula in cell G11:**

### Explaining array formula in cell D11

**Step 1 - Count the number of cells within a range that meet a given condition**

COUNTIF(Table1[Value],Table1[Value])

returns

{1;1;1;0;1;1;1;1;1;...}

**Step 2 - Check if value in array is a duplicate**

COUNTIF(Table1[Value],Table1[Value])<>1

becomes

{1;1;1;0;1;1;1;1;1;...}<>1

and returns

{FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;...}

** Step 3 - Check if table value is a blank**

(Table1[Value]="")

returns

{FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE; ...}

**Step 4 - Return table value if conditions are met**

IF((COUNTIF(Table1[Value],Table1[Value])<>1)+(Table1[Value]=""),"",Table1[Value])

becomes

IF({FALSE;FALSE;FALSE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE; ...}, "", {72;373;230;0;311;424;460;418;665})

and returns

{72;373;230;"";311;424;460;418;665;...}

**Step 5 - Return max value**

MAX(IF((COUNTIF(Table1[Value],Table1[Value])<>1)+(Table1[Value]=""),"",Table1[Value]))

becomes

=MAX({72;373;230;"";311;424;460;418;665;...})

and returns 694 in cell D11.

### Download excel *.xlsx file

Find max unique value from a range that have duplicate numbers and blanks.xlsx

How to use a Table name in Data Validation Lists and Conditional Formatting formulas

David Hager gave this valuable comment about how to reference a table name in conditional formatting formulas: =INDIRECT("Table1[Start]") Watch this video to […]

Extract unique distinct values from a filtered Excel defined Table [UDF and Formula]

Robert Jr asks: Oscar, I am using the VBA code & FilterUniqueSort array to generate unique lists that drive Selection […]

Count unique distinct values in a filtered table

A few days ago Debra Dalgleish described how to create a Line Between Dates in Filtered List. She modified a […]

Remove common records between two data sets

This article demonstrates how to filter records occurring in only one out of two Excel defined tables. It also shows […]

Cyril asks how to hide all columns of a range except columns whose header is found in specific cells. I am […]

Highlight duplicates in a filtered Excel defined table

You can highlight duplicates in an excel defined table using conditional formatting. However, that won´t work if you only want […]

This article demonstrates how to filter duplicate records using a simple formula and an Excel defined table.

Copy filtered Excel tables [VBA]

Today I want to share some pretty useful macros. My first macro copies an excel defined table with vba. It is […]

Today I am going to demonstrate how amazing pivot tables are! Take a look at this time sheet. You can expand […]

Extract unique distinct values based on a filtered Excel defined Table

This blog post demonstrates how to filter unique distinct values from an Excel table dynamically. When you change or add […]

### Leave a Reply

### How to comment

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

<code>Insert your formula here.</code>

**Convert less than and larger than signs**

Use html character entities instead of less than and larger than signs.

< becomes < and > becomes >

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

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

Put your VBA code here.

[/vb]

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

Upload picture to postimage.org or imgur

Use the img tag, like this: <img src="Insert pic link here">

**Contact Oscar**

You can contact me through this contact form