IF statement - Only 1 maximum value, and not more if duplicates.

CV12

Board Regular
Joined
Apr 6, 2020
Messages
82
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi,

In the sheet below I used an if statement to find the maximum value in some spilled data.
In this small example, there are duplicates of some values. Is it somehow possible to only get one maximum? It doesn't matter whether it is the first or the last one out of the duplicates.
The number '5' in either cell G11 or G12 should be #N/A

Thanks in advance.


Results.xlsm
EFGHIJ
1
2#N/A11
3#N/A11
4#N/A22
5#N/A22
6#N/A33
7#N/A33
8#N/A44
9#N/A44
10555
11555
12
13
14
15Need only 1 number 5
Sheet3
Cell Formulas
RangeFormula
G2:G11G2=(IF(H2#=MAX(H2#),H2#,NA()))
H2:H11H2=(J2:J11)
Dynamic array formulas.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hello,

In cell G2 type =IF(H2=LARGE($H$2:$H$10,1),H2,"#N/A")
In cell G3 type =IF(ISNUMBER(G2),"#N/A",IF(H3=LARGE($H$2:$H$10,1),H3,"#N/A"))

Copy cell G3 down to G11

Jamie
 
Upvote 0
Hi Jamie,

Thanks for your reply. The formula works, but I would like to have it working with spilled data. Is that also possible?

Thanks
 
Upvote 0
How about
+Fluff 1.xlsm
GHIJ
1
2#N/A11
3#N/A11
4#N/A22
5#N/A22
6#N/A33
7#N/A33
8#N/A44
9#N/A44
10555
11#N/A55
12
Main
Cell Formulas
RangeFormula
G2:G11G2=LET(m,MAX(H2#),a,IF(H2#=m,ROW(H2#),""),IF((H2#=m)*(a=MIN(a)),m,NA()))
H2:H11H2=(J2:J11)
Dynamic array formulas.
 
Upvote 0
Solution
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,387
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top