Finding The "Second" Value From Bottom Of Column...

Aitch

Board Regular
Joined
Jan 27, 2019
Messages
119
Office Version
  1. 2010
Platform
  1. Windows
I have a column of between 10 to 50 cells which contain a single number - I need to find the first instance of a 9 from the bottom

I use this formula in column B with a changing COUNTIF function which works well =

A B
4 =IF(AND(A2=9,COUNTIF(A2:A,"=9")=1 , A2 , ""))
6 =IF(AND(A2=9,COUNTIF(A3:A,"=9")=1 , A3 , ""))
7 =IF(AND(A2=9,COUNTIF(A4:A,"=9")=1 , A4 , ""))
6
8
6
9
1
0
3
5
8
9 = 9

This finds the 9 at the very bottom of the column - but now I need a formula which will "ignore" the bottom 10% and look further up to find the second 9 value in the middle...

Would be grateful for any help!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
If you want to find the penultimate 9, try
=IF(AND(A2=9,COUNTIF(A2:A$50,"9")=2 ), A2, "")
 
Upvote 0
If you want to find the penultimate 9, try
=IF(AND(A2=9,COUNTIF(A2:A$50,"9")=2 ), A2, "")

Thanks for the reply!

This finds the penultimate constantly - is there a way to make it show the 2nd to last, only if the 1st last is in the bottom 10% ?
 
Upvote 0
What do you mean by "the bottom 10%"?
Also what should happen if the last 9 is not in the bottom 10%?
 
Upvote 0
What do you mean by "the bottom 10%"?
Also what should happen if the last 9 is not in the bottom 10%?

I mean if there are 20 rows of values in column A - it ignores any 9's in the bottom 10%, so rows 19 and 20 are not considered

If the last 9 is not in the bottom 10%, then it functions as normal and highlights that one

Really appreciate your help Fluff!
 
Upvote 0
Awesome!

Am I doing something wrong in copying it down - it seems to break sometimes?

In a column of 10 like this:
1
9
1
9
1
1
1
9 9
1
1
It works perfectly showing the 8th 9

But if there is another 9 below it:
1
9
1
9
1
1
1
9
9

1
It shows nothing - instead of the 9th 9?
 
Upvote 0
How about
Excel Formula:
=IF(AND(A2=9,COUNTIF(A2:INDEX($A$2:$A$50,COUNT($A$2:$A$50)*0.9),9)=1,ROW(A1)<=COUNT($A$2:$A$50)*0.9), A2, "")
 
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,816
Members
449,095
Latest member
m_smith_solihull

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