ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pick numbers (https://www.excelbanter.com/excel-programming/440860-pick-numbers.html)

Mia

Pick numbers
 
Hi,

If I have a string of numbers, for example 51900125 and I want to pick
number three (in this example 9) in a specified cell, what shall i type.
I have tried Left and right but then I got a string of figures.
Do anuone know how to solve this?


--
Best regards
Mia

Barb Reinhardt

Pick numbers
 
You'd use MID.

=MID("51900125",3,1)

Is that what you're looking for?
--
HTH,

Barb Reinhardt



"Mia" wrote:

Hi,

If I have a string of numbers, for example 51900125 and I want to pick
number three (in this example 9) in a specified cell, what shall i type.
I have tried Left and right but then I got a string of figures.
Do anuone know how to solve this?


--
Best regards
Mia


helene and gabor

Pick numbers
 
=mid(c7,3,1)
enters the third character from the string in c7.

best regards

Gabor Sebo

-------------------------------------------
"Mia" wrote in message
...
Hi,

If I have a string of numbers, for example 51900125 and I want to pick
number three (in this example 9) in a specified cell, what shall i type.
I have tried Left and right but then I got a string of figures.
Do anuone know how to solve this?


--
Best regards
Mia



Rick Rothstein

Pick numbers
 
As others have mentioned, you would use the MID function. This function can
retrieve one or more characters from a text string. The function's first
argument is the text you want to extract characters from, its second
argument is the position number within the string that you want to start
extracting characters from and its third argument is the total number of
characters to extract. So, assuming cell A1 contained your 51900125 piece of
text, you would use this formula to extract the single character at position
3 in the text...

=MID(A1,3,1)

If you had wanted to pull the four characters out of the text string
starting at position 3 (that is, the numbers 9001), you would use this
formula...

=MID(A1,3,4)

That should give you enough information to see how to use the function in
the future. Interestingly enough, you could have done what you originally
asked for using only the RIGHT and LEFT functions that you wrote that you
had tried; consider this formula to retrieve the 3rd character (the 9 in the
text 51900125)...

=RIGHT(LEFT(A1,3))

Of course, you should always use the MID function to pull characters from
within the middle of a text string and not the above combination formula
(one function call is more efficient than two function calls)... I only
showed it to you as an interesting side comment.

--
Rick (MVP - Excel)



"Mia" wrote in message
...
Hi,

If I have a string of numbers, for example 51900125 and I want to pick
number three (in this example 9) in a specified cell, what shall i type.
I have tried Left and right but then I got a string of figures.
Do anuone know how to solve this?


--
Best regards
Mia



Mia

Pick numbers
 
Thank you!

--
Best regards
Mia


"Mia" skrev:

Hi,

If I have a string of numbers, for example 51900125 and I want to pick
number three (in this example 9) in a specified cell, what shall i type.
I have tried Left and right but then I got a string of figures.
Do anuone know how to solve this?


--
Best regards
Mia


Mia

Pick numbers
 
Thank you!

--
Best regards
Mia


"helene and gabor" skrev:

=mid(c7,3,1)
enters the third character from the string in c7.

best regards

Gabor Sebo

-------------------------------------------
"Mia" wrote in message
...
Hi,

If I have a string of numbers, for example 51900125 and I want to pick
number three (in this example 9) in a specified cell, what shall i type.
I have tried Left and right but then I got a string of figures.
Do anuone know how to solve this?


--
Best regards
Mia



Mia

Pick numbers
 
Thank you!!!!
--
Best regards
Mia


"Barb Reinhardt" skrev:

You'd use MID.

=MID("51900125",3,1)

Is that what you're looking for?
--
HTH,

Barb Reinhardt



"Mia" wrote:

Hi,

If I have a string of numbers, for example 51900125 and I want to pick
number three (in this example 9) in a specified cell, what shall i type.
I have tried Left and right but then I got a string of figures.
Do anuone know how to solve this?


--
Best regards
Mia


Mia

Pick numbers
 
Thank you!
--
Best regards
Mia


"Rick Rothstein" skrev:

As others have mentioned, you would use the MID function. This function can
retrieve one or more characters from a text string. The function's first
argument is the text you want to extract characters from, its second
argument is the position number within the string that you want to start
extracting characters from and its third argument is the total number of
characters to extract. So, assuming cell A1 contained your 51900125 piece of
text, you would use this formula to extract the single character at position
3 in the text...

=MID(A1,3,1)

If you had wanted to pull the four characters out of the text string
starting at position 3 (that is, the numbers 9001), you would use this
formula...

=MID(A1,3,4)

That should give you enough information to see how to use the function in
the future. Interestingly enough, you could have done what you originally
asked for using only the RIGHT and LEFT functions that you wrote that you
had tried; consider this formula to retrieve the 3rd character (the 9 in the
text 51900125)...

=RIGHT(LEFT(A1,3))

Of course, you should always use the MID function to pull characters from
within the middle of a text string and not the above combination formula
(one function call is more efficient than two function calls)... I only
showed it to you as an interesting side comment.

--
Rick (MVP - Excel)



"Mia" wrote in message
...
Hi,

If I have a string of numbers, for example 51900125 and I want to pick
number three (in this example 9) in a specified cell, what shall i type.
I have tried Left and right but then I got a string of figures.
Do anuone know how to solve this?


--
Best regards
Mia


.



All times are GMT +1. The time now is 02:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com