Easy question!

Overkill32

New Member
Joined
May 13, 2011
Messages
49
Is there a function that can return the value of a specific character in a string or number acording to its position? Like i have the string "Hello", what can i use to return the third character "l"? Or if i have the number "100456", how can i return the third character (which is 0).

I know it's possible using a combination of left() or right() function but I was wondering if there were any user friendly function that would achieve the same task?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi

Try the MID function instead. eg:=MID(A1,3,1) would return "L" from Hello

George

Is there a function that can return the value of a specific character in a string or number acording to its position? Like i have the string "Hello", what can i use to return the third character "l"? Or if i have the number "100456", how can i return the third character (which is 0).

I know it's possible using a combination of left() or right() function but I was wondering if there were any user friendly function that would achieve the same task?
 
Upvote 0
kinda funny but try..
=RIGHT(RIGHT(LEFT(A1,3),2),1)

if you've just 1 letter, it will return 1 letter, 2 then 2, 3 then 3, 4 then 3 and so on.. :)
 
Upvote 0
Is there a function that can return the value of a specific character in a string or number acording to its position? Like i have the string "Hello", what can i use to return the third character "l"? Or if i have the number "100456", how can i return the third character (which is 0).

I know it's possible using a combination of left() or right() function but I was wondering if there were any user friendly function that would achieve the same task?
The MID function...

A1 = some entry like: Hello

=MID(A1,3,1)

Returns l

A1 = 100456

=MID(A1,3,1)

Returns "0" as a TEXT number. It's not the numeric value 0.

If you need to parse numeric strings and you want the returned value to remain a numeric value then:

A1 = 100456

=--MID(A1,3,1)

Returns numeric 0
 
Upvote 0
:eeek::) complicated but funny indeed

kinda funny but try..
=RIGHT(RIGHT(LEFT(A1,3),2),1)

if you've just 1 letter, it will return 1 letter, 2 then 2, 3 then 3, 4 then 3 and so on.. :)
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,835
Members
452,947
Latest member
Gerry_F

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