Find first number in column using match/index function

maldonadocj

Board Regular
Joined
Oct 19, 2004
Messages
103
Hello,
Can someone pls. assist me with providing a formula, ideally using the index/match functions, to locate the first absolute (may have positive or negative values) number in a column? I have added snapshots of how the data would look on the two sheets they are currently located on.

Thank you in advance.

Sheet 1

IDValue
12345678ANULL
12345678A100
12345678A150
12345678B200
<colgroup><col width="118" style="width: 89pt; mso-width-source: userset; mso-width-alt: 4315;"> <col width="64" style="width: 48pt;"> <tbody> </tbody>

Sheet2

IDExpected Result
12345678A100
<colgroup><col width="93" style="width: 70pt; mso-width-source: userset; mso-width-alt: 3401;"> <col width="152" style="width: 114pt; mso-width-source: userset; mso-width-alt: 5558;"> <tbody> </tbody>
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Like this maybe:


Excel 2010
AB
1IDValue
212345678ANULL
312345678A100
412345678A150
512345678B200
6
712345678A100
Sheet14
Cell Formulas
RangeFormula
A7{=INDEX(A2:A5,MATCH(TRUE,ISNUMBER(1*(B2:B5)),0))}
B7{=INDEX(B2:B5,MATCH(TRUE,ISNUMBER(1*(B2:B5)),0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Hello Momentman,

Thank you for the prompt response. Pls forgive my ignorance but can you pls. explain to me how the formula in cell B7 is linked to the id noted in cell A7? Pls. note that it is not necessary to have a formula to define the id in cell A7 as the ids will be defined as a user input as noted in Sheet 2 in my initial post.

Pls. advise.

Best regards,
maldonadocj
 
Last edited:
Upvote 0
Try changing formula in B7 to example below.

This is an array formula and must be entered with
Excel Workbook
ABC
1IDValue
212345678ANULL
312345678A100
412345678A150
512345678B200
6
712345678A100
8
CTRL-SHIFT-ENTER
 
Upvote 0
Hello Momentman,

Thank you for the prompt response. Pls forgive my ignorance but can you pls. explain to me how the formula in cell B7 is linked to the id noted in cell A7? Pls. note that it is not necessary to have a formula to define the id in cell A7 as the ids will be defined as a user input as noted in Sheet 2 in my initial post.

Pls. advise.

Best regards,
maldonadocj

I must have answered the wrong question, thought you needed the first number in the series irrespective of IDs.

AhoyNC's formula will do what you need , this portion handles your query (A2:A5=A7) which is what i didn't have in mine

Victor
 
Upvote 0
Hello AhoyNC,

Thank you very much for your assistance. The formula worked perfectly. However, I have additional nuances that would need to be added. Can you pls. provide me an additional formula that would retrieve the date associated with the numerical value that was returned from your formula? Additionally, is it possible to revise your formula so that in addition to retrieving the numerical value it will also retrieve any numerical values that were imbedded in the string? Pls. see example below:

ABC
1IDValueDate
212345678ANULL1/15/2013
312345678A100H1/25/2013
412345678A1501/26/2013
512345678A2001/27/2013
612345678B2509/29/2013
7
812345678A1001/25/2013

<tbody>
</tbody>

Best regards,
maldonadocj
 
Last edited:
Upvote 0
Hello Momentman,

No worries. I appreciate that you followed up. I sent a follow up post to AhoyNC regarding several new additions to the formula provided. Pls. feel free to review my post and let me know if you are also able to address the requests.

Thank you.
maldonadocj
 
Upvote 0
Is there any pattern to how the numbers appear in the string. Will they always be at the beginning and 3 digits as in your example?
 
Upvote 0
Hello AhoyNC,

Great question. There is no set pattern. The text may also be in front such as "Low100" or both "LM100a". Hope this helps.
Thank you,
maldonadocj
 
Upvote 0
Will the numbers always be together as in your post Low100 LM100a. Could you ever have "Low10ab45"?
 
Upvote 0

Forum statistics

Threads
1,214,399
Messages
6,119,279
Members
448,884
Latest member
chuffman431a

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