Find character position in a string for IF statement

JIM456

New Member
Joined
Mar 9, 2005
Messages
13
This is hopefully simple! But not for me! I have a series of account numbers in the format xxxx-xxx, where I need to extract the 5th character (ex 6005-201, in this case the "2") in order to use in an IF Statement. One final note, the 6005-201 exists as a formula; do I have to value it as text?

Please help!


Thanks,

Jim
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Are they ALWAYS in the format of "xxxx-xxx"?
Are they by themselves, or part of a larger string?

If by themselves, try using:
=MID(A1,6,1)
where A1 is whatever cell the value is in.

If they are parts of larger strings, can you post some examples that cover the array of different string structures they may be in?

Also, what exactly does the formula look like?
It may be even simpler to pull from the same spot the formula is.
 
Upvote 0
Solution
Are they ALWAYS in the format of "xxxx-xxx"?
Are they by themselves, or part of a larger string?

If by themselves, try using:
=MID(A1,6,1)
where A1 is whatever cell the value is in.

If they are parts of larger strings, can you post some examples that cover the array of different string structures they may be in?

Also, what exactly does the formula look like?
It may be even simpler to pull from the same spot the formula is.
THANKS! That works.
 
Upvote 0
You are welcome!
Glad I was able to help.
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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