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

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
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,529
Messages
6,125,344
Members
449,219
Latest member
Smiqer

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