Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Locate and length functions
I am looking for a locate function, WHat I need to do is
find the length of a string up to the first instance of particular character and determine how many characters are before it, then use that result in a left statement something like x=length(string,locate("-")) left(string,x) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Locate and length functions
Nigel
Try the InStr() function InStr(1,"Nick Hodge","o") returns 7 -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England HIS "Nigel Bennett" wrote in message ... I am looking for a locate function, WHat I need to do is find the length of a string up to the first instance of particular character and determine how many characters are before it, then use that result in a left statement something like x=length(string,locate("-")) left(string,x) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Locate and length functions
x = Instr(String,"-")
y = left(string,x) -- regards, Tom Ogilvy "Nigel Bennett" wrote in message ... I am looking for a locate function, WHat I need to do is find the length of a string up to the first instance of particular character and determine how many characters are before it, then use that result in a left statement something like x=length(string,locate("-")) left(string,x) |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Locate and length functions
Try the find function in Excel or the instr() in VBA
"Nigel Bennett" wrote: I am looking for a locate function, WHat I need to do is find the length of a string up to the first instance of particular character and determine how many characters are before it, then use that result in a left statement something like x=length(string,locate("-")) left(string,x) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to locate the value? | Excel Discussion (Misc queries) | |||
Length that falls within a length interval? | Excel Worksheet Functions | |||
Validation length, Range length | Excel Discussion (Misc queries) | |||
STILL CAN'T LOCATE XML | New Users to Excel | |||
Locate max value cell | Excel Programming |