Extract second numeric value in a column

jaime1182

New Member
Joined
Dec 11, 2007
Messages
49
Office Version
  1. 2013
Platform
  1. Windows
Hi guys! Hope you have all been well.

I am getting stumped with a formula problem. I need to retrieve the second numeric value in a column.

Apple
Banana
123
Cupcake
987

At the moment the data looks like this (there are sometimes blank cells in between rows). I need the return to be "987"

I am going about this the very inefficient way by =ISNUMBER(A1) and then working out if it's the second "TRUE".

There has to be a smarter way to do this? Can someone help? Thanks
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Seem like there should be a simpler formula than the following. Anyway, I cannot test this for you as I do not have your version of Excel, but this works for me (change the range as necessary) although I am guessing you will have to commit the formula using CTRL+SHIFT+ENTER and not just Enter by itself...

=INDEX(A1:A10,LARGE(IF(ISNUMBER(A1:A10),ROW(A1:A10),),2))
 
Upvote 1
Solution
Seem like there should be a simpler formula than the following. Anyway, I cannot test this for you as I do not have your version of Excel, but this works for me (change the range as necessary) although I am guessing you will have to commit the formula using CTRL+SHIFT+ENTER and not just Enter by itself...

=INDEX(A1:A10,LARGE(IF(ISNUMBER(A1:A10),ROW(A1:A10),),2))
I believe you really want to use SMALL.
Another way:
Code:
=IFERROR(INDEX(A1:A10,AGGREGATE(15,6,ROW(A1:A10)/ISNUMBER(A1:A10),2)),"Not found")
 
Upvote 1
I believe you really want to use SMALL.
It would need more than just that change.

@jaime1182
I don't know if it would be likely for you but in case at a later date new rows might be inserted at the top of the worksheet, you might want to consider this type of formula that would still return the second number in the column. I have assumed that the second number would occur within the first 1,000 rows but you can make that number bigger if you want.

Excel Formula:
=INDEX(A:A,AGGREGATE(15,6,ROW(INDEX(A:A,1):INDEX(A:A,1000))/ISNUMBER(INDEX(A:A,1):INDEX(A:A,1000)),2))
 
Upvote 1
Excel Formula:
=INDEX(A:A,AGGREGATE(15,6,ROW(INDEX(A:A,1):INDEX(A:A,1000))/ISNUMBER(INDEX(A:A,1):INDEX(A:A,1000)),2))
I wonder about what the differences are between the two ways of expressing range A1:A1000?
mine
Code:
ROW(A1:A1000)
and, you must have a reason of using this:
ROW(INDEX(A:A,1):INDEX(A:A,1000))
 
Upvote 0
you must have a reason of using this:
Yes, I mentioned in my post. It may not happen for the OP but it relates to if rows might be added later. Here are our two formulas showing the correct result.

23 11 01.xlsm
ABC
1Apple987987
2Banana
3123
4Cupcake
5
6987
7Apple
833
9Pear
1044
Sheet1
Cell Formulas
RangeFormula
B1B1=IFERROR(INDEX(A1:A10,AGGREGATE(15,6,ROW(A1:A10)/ISNUMBER(A1:A10),2)),"Not found")
C1C1=INDEX(A:A,AGGREGATE(15,6,ROW(INDEX(A:A,1):INDEX(A:A,1000))/ISNUMBER(INDEX(A:A,1):INDEX(A:A,1000)),2))


.. but look what happens if a new row (& possibly new data) is added at the top.

23 11 01.xlsm
ABC
1Heading
2AppleApple987
3Banana
4123
5Cupcake
6
7987
8Apple
933
10Pear
1144
Sheet1
Cell Formulas
RangeFormula
B2B2=IFERROR(INDEX(A2:A11,AGGREGATE(15,6,ROW(A2:A11)/ISNUMBER(A2:A11),2)),"Not found")
C2C2=INDEX(A:A,AGGREGATE(15,6,ROW(INDEX(A:A,1):INDEX(A:A,1000))/ISNUMBER(INDEX(A:A,1):INDEX(A:A,1000)),2))


Both solutions worked!.... Rick's on my own old outdated version of Excel.
Are you sure? It returns not the second number but the second last number for me.

23 11 01.xlsm
AD
1Apple33
2Banana
3123
4Cupcake
5
6987
7Apple
833
9Pear
1044
Sheet1
Cell Formulas
RangeFormula
D1D1=INDEX(A1:A10,LARGE(IF(ISNUMBER(A1:A10),ROW(A1:A10),),2))
Press CTRL+SHIFT+ENTER to enter array formulas.


work computer (which has 365)
With 365, you could also use this.
BTW, my previous formula should also work on any Excel version from Excel 2000 onwards (though it may(?) also need Ctrl+Shift+Enter confirmation)

23 11 01.xlsm
AE
1Apple987
2Banana
3123
4Cupcake
5
6987
7Apple
833
9Pear
1044
Sheet1
Cell Formulas
RangeFormula
E1E1=INDEX(FILTER(A1:A10,ISNUMBER(A1:A10)),2)
 
Upvote 0
Hi Peter. That's strange. Let me poke about why I was able to get that number I'm expecting. Having a gap between the numbers don't impact it but I am getting that "correct" number showing up on my other sheet. Unless ... there's a duplicate somewhere that just happens ... Garh. I hate big tables :'(
 
Upvote 0
Unless ... there's a duplicate somewhere that just happens
That would be a possibility.
Simple way would be to test on a few smaller samples to see if it gives you confidence that it is working on a large sample.
 
Upvote 0

Forum statistics

Threads
1,215,268
Messages
6,123,969
Members
449,137
Latest member
yeti1016

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