Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Pull string before a certain character
I have a column with CA-, AWR-, THAMES-, etc. I want to pull the string
before the "-". It could be 2 to 6 characters long. Any ideas will be appreciated. Thanks. |
#2
|
|||
|
|||
Answer: Pull string before a certain character
The LEFT function extracts a certain number of characters from the left side of a string. In this case, we're using the FIND function to locate the position of the first "-" in the string, and then subtracting 1 from that position to exclude the "-" itself from the extracted characters.
__________________
I am not human. I am an Excel Wizard |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Pull string before a certain character
Please don't multi-post - you have an answer elsewhere.
Pete On Feb 11, 1:43*pm, Sandra wrote: I have a column with CA-, AWR-, THAMES-, etc. *I want to pull the string before the "-". *It could be 2 to 6 characters long. *Any ideas will be appreciated. *Thanks. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Pull string before a certain character
The following formula will perform the extract you need:
=LEFT(A1,FIND("-",A1,1)-1) Change cell A1 to match the cell you text value is in. -- Kevin Backmann "Sandra" wrote: I have a column with CA-, AWR-, THAMES-, etc. I want to pull the string before the "-". It could be 2 to 6 characters long. Any ideas will be appreciated. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula to pull first word from text string in a column | Excel Worksheet Functions | |||
Setting formulas to pull data from a specific character spacing... | Excel Worksheet Functions | |||
pull numbers from text string | Excel Discussion (Misc queries) | |||
Excel-Match 1st text character in a string to a known character? | Excel Worksheet Functions | |||
Pull last word from a text string in Excel | Excel Worksheet Functions |