How to make every number in a range of cells unique???

Mark McInerney

Active Member
Joined
Apr 4, 2012
Messages
288
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a large range of data - I need to use range formulas using If and Large combinations to return the largest number when certain conditions are met.

As the dataset is large, there are duplicate values.

As a workaround I add a very small number to every number in the range, to create a unique value in every cell in the range.

Is there a better way to achieve this - make every cell in a range unique?

Thanks - Mark.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi Mark,

I'd actually take a different approach and create a column with the distinct rank. You can then use that rank as you unique identifier to find the row of data you want.

Here's my list of numbers (with many duplicates) and I'm just showing the first 14 of 180 entries. The 314 is the largest number but I can make it rank 1,2,3,4 instead of all 1.

IJK
NumberDistinct Rank

<tbody>
[TD="align: center"]1[/TD]

[TD="align: right"][/TD]

[TD="align: center"]2[/TD]
[TD="align: right"]114[/TD]
[TD="align: right"][/TD]
[TD="align: right"]7[/TD]

[TD="align: center"]3[/TD]
[TD="align: right"]114[/TD]
[TD="align: right"][/TD]
[TD="align: right"]8[/TD]

[TD="align: center"]4[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"][/TD]
[TD="align: right"]94[/TD]

[TD="align: center"]5[/TD]
[TD="align: right"]58[/TD]
[TD="align: right"][/TD]
[TD="align: right"]82[/TD]

[TD="align: center"]6[/TD]
[TD="align: right"]58[/TD]
[TD="align: right"][/TD]
[TD="align: right"]83[/TD]

[TD="align: center"]7[/TD]
[TD="align: right"]87[/TD]
[TD="align: right"][/TD]
[TD="align: right"]27[/TD]

[TD="align: center"]8[/TD]
[TD="align: right"]314[/TD]
[TD="align: right"][/TD]
[TD="align: right"]1[/TD]

[TD="align: center"]9[/TD]
[TD="align: right"]314[/TD]
[TD="align: right"][/TD]
[TD="align: right"]2[/TD]

[TD="align: center"]10[/TD]
[TD="align: right"]314[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3[/TD]

[TD="align: center"]11[/TD]
[TD="align: right"]314[/TD]
[TD="align: right"][/TD]
[TD="align: right"]4[/TD]

[TD="align: center"]12[/TD]
[TD="align: right"]135[/TD]
[TD="align: right"][/TD]
[TD="align: right"]5[/TD]

[TD="align: center"]13[/TD]
[TD="align: right"]135[/TD]
[TD="align: right"][/TD]
[TD="align: right"]6[/TD]

[TD="align: center"]14[/TD]
[TD="align: right"]32[/TD]
[TD="align: right"][/TD]
[TD="align: right"]128[/TD]

</tbody>
Sheet3 (2)

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<tbody>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]K2[/TH]
[TD="align: left"]=RANK.EQ(I2,$I$2:$I$181,0)+COUNTIF($I$2:I2,I2)-1[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]


P.S. I'd use the LARGE option of AGGREGATE rather than LARGE as it's faster on large datasets.
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,111
Members
453,021
Latest member
Justyna P

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