Need to find the Relative Number from a List of Numbers

silverlucky5

New Member
Joined
Sep 8, 2009
Messages
35
My problem is this:
I have a column of numbers that are not necessarily sequential and are not sorted numerically.
Using a formula, I would like to return the relative number of those numbers in a new column.
For example: I have a column of 4 numbers: 1, 1, 4, 2, 1, 1, 5. I want to return, respectively, in a new column: 1, 1, 3, 2, 1, 1, 4.
I have tried all kinds of formulas using INDEX, MATCH, SMALL, LARGE, MIN, MAX, but just can't seem to figure it out.
I have attached sample data in case needed. https://www.dropbox.com/s/1djt8sfv40acwmi/Absolute Reference.xlsx?dl=0
Any help would be greatly appreciated!
Thanks!

<tbody>
</tbody>
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Given the following...

Row\Col
A​
1​
1
2​
1​
3​
4​
4​
2​
5​
1​
6​
6​
7​
5​

would this below be the output?

Row\Col
B​
1​
1​
2​
1​
3​
3​
4​
2​
5​
1​
6​
5​
7​
4​
 
Upvote 0
Hi Aladin, yes indeed...the output you show is what I am looking for!

In B1 control+shift+enter, not just enter, and copy down:
Rich (BB code):
=MATCH(A1,SMALL(IF(FREQUENCY($A$1:$A$7,$A$1:$A$7),$A$1:$A$7),
     ROW(INDIRECT("1:"&SUM(IF(FREQUENCY(MATCH($A$1:$A$7,$A$1:$A$7,0),
     MATCH($A$1:$A$7,$A$1:$A$7,0)),1))))),0)
 
Upvote 0
Here's a considerably shorter one, & without the volatile INDIRECT function, that I think also does the same job.
Also confirmed with Ctrl+Shift+Enter before copying down.

Excel Workbook
AB
111
211
343
422
511
665
754
Posn
 
Last edited:
Upvote 0
that works perfectly! Thank you SO much! :)

You are welcome.

Since we have to do with numbers (integers), we can set up distinct count part accordingly, giving us a shorter formula.

In B1 control+shift+enter:
Rich (BB code):
=MATCH(A1,SMALL(IF(FREQUENCY($A$1:$A$7,$A$1:$A$7),$A$1:$A$7),
    ROW(INDIRECT("1:"&SUM(IF(FREQUENCY($A$1:$A$7,$A$1:$A$7),1))))),0)

If we want it to be generic...
 
Upvote 0
Since we have to do with numbers (integers), we can set up distinct count part accordingly, giving us a shorter formula.
But not recommending this over the non-volatile, more efficient (& shorter) alternative?


If we want it to be generic...
Meaning?


I have attached sample data in case needed.
It seems that you actually have a further 'grouping' criteria. Try this in cell C11 of the sample layout. Still confirmed with C+S+E before copying down.

Code:
=COUNT(IF(A$11:A$43=A11,IF(B$11:B$43<B11,IF(MATCH(B$11:B$43,IF(A$11:A$43=A11,B$11:B$43),0)=ROW(B$11:B$43)-ROW(B$11)+1,1,NA()))))+1
 
Upvote 0
Thank you Peter...I was using Aladin's formula and I was going to figure out how to make it work with the "2nd grouping"....but your new formula does it for me....Can't thank you both enough...you have saved me an inordinate amount of time as the spreadsheet I am working with is close to 200K rows! :)
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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