Pick numbers

  • Thread starter Thread starter Mia
  • Start date Start date
M

Mia

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?
 
=mid(c7,3,1)
enters the third character from the string in c7.

best regards

Gabor Sebo
 
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.
 
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

-------------------------------------------
 
Back
Top