LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Select the first number/numbers in a cell input into another colum

On Mon, 14 Apr 2008 08:27:01 -0700, Sue wrote:

I have a description cell that has variable alphanumeric characters. the
first one to two numbers I would like to copy to another column for the size
of the description
i.e. AA_NAAAa NNN AA N. The number I want is the first number unless the
description shows AANNANN NNNN aAa n, I would want the first two numbers.
these numbers indicate the size of the material. I don't know if a macro
and/or a function would be the best way to go.


If there will be a maximum of two numbers in the first group of numbers, then:

=LOOKUP(9.9E+307,--MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"012345 6789")),
ROW(INDIRECT("1:"&LEN(A1)))))

If there could be more than two numbers, but you only want to return the first
two, then:

=LEFT(LOOKUP(9.9E+307,--MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},
A1&"0123456789")),ROW(INDIRECT("1:"&LEN(A1))))),2 )

or, to return the value as numeric rather than text:

=--LEFT(LOOKUP(9.9E+307,--MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},
A1&"0123456789")),ROW(INDIRECT("1:"&LEN(A1))))),2 )
--ron
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I select a number from a specific group of numbers? motol Excel Worksheet Functions 2 August 24th 06 05:52 AM
How do I input numbers used to select cells in several columns BC2233 Excel Discussion (Misc queries) 3 February 16th 06 05:35 PM
Select cell from range based on input in excel xp dingy101 Excel Discussion (Misc queries) 3 November 20th 05 12:05 AM
Set a formula to always select the last value present in a colum bpiepgrass Excel Worksheet Functions 2 March 23rd 05 09:08 AM
How do I enter a prefix number to a colum of numbers Newbee101l Excel Worksheet Functions 3 November 19th 04 05:07 PM


All times are GMT +1. The time now is 06:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"