How to see last four numeric values above in a column

alexvistas

New Member
Joined
Mar 2, 2010
Messages
23
Hello,
I am looking for a formula that will look up in a column from the row I am in and tell me the first 4 unique values it sees ignoring gaps. So that the result should look something like below. So each column row for HHHHLLLL will show the first above values for the High and Low columns. I hope this makes sense and thank you in advance for any solutions, regards Alex

eg

HighLowHHHHLLLL
8
10
5
1
4
7
3
12
2
2
This row for eg1271082341

<tbody>
</tbody>
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hello Alex,

My initial impression is that a single formula would be rather complex to handle all your conditions ...

Before going any further ...

1. Could you do with several helper columns ...?

2. Would you rather rely on a specific UDF ...?
 
Upvote 0
Hello Alex,

My initial impression is that a single formula would be rather complex to handle all your conditions ...

Before going any further ...

1. Could you do with several helper columns ...?

2. Would you rather rely on a specific UDF ...?

Hello,
yes I am quite happy to have any helper columns necessary, whatever makes this possible, many thanks
 
Upvote 0
Hello,

As soon as I have a moment ... will give it a try ... :wink:
 
Upvote 0
If I understand your question correctly I believe you can address your issue with 2 helper columns and a row of formulas.
Assume Col B is your HIGH col and Col C is your LOW column Data resides in rows 3 to 13

In your helper column say col D paste: =IF(COUNTIF(B3:B$13,B3)=1,B3,0) and copy the formula to the bottom of your data in this case row 13 (This will remove all duplicate values from the column staring at the bottom) copy the formulas to the next column. The result should look something like the below:

HighLowHighLow
8
80
10100
700
505
101
404
770
303
12120
200
202
<colgroup><col width="64" style="width: 48pt;" span="4"> <tbody> </tbody>

Results:12
71082341
<colgroup><col width="64" style="width: 48pt;" span="8"> <tbody> </tbody>


For your results use an array formula: =INDEX($D$3:$D$13,LARGE(IF($D$3:$D$13>0,ROW($D$3:$D$13)-2,0),COLUMN(A1))) make sure you type "Ctrl+Shift+Enter" when you enter the formula to get excel to recognize it as an array formula. Copy this into the next 3 columns to get 4 results.

Do the same thing for the LOW numbers =INDEX($E$3:$E$13,LARGE(IF($E$3:$E$13>0,ROW($E$3:$E$13)-2,0),COLUMN(A1)))

This should give you the first 4 unique numbers in each column starting from the bottom of the column.

If you just need the first 4 Large or Small numbers use LARGE and SMALL functions respectively. If you need the results in a single cell you can use CONCATENATE to put the results together.

I hope this is what you are looking for.
 
Upvote 0
Hello again,

Once you have tested the event macro ... let me know if it does fit the bill ...

HTH
 
Upvote 0
Glad to hear the event macro is performing as expected ...

In order to copy it to your workbook ... make sure to copy the Private Sub Worksheet_BeforeDoubleClick() macro to the sheet module ...

HTH
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,917
Members
449,093
Latest member
dbomb1414

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