+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Nigel Bennett
    Guest

    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. #2
    Tom Ogilvy
    Guest

    Re: Locate and length functions

    x = Instr(String,"-")
    y = left(string,x)

    --
    regards,
    Tom Ogilvy

    "Nigel Bennett" <nigelben@yahoo.com> wrote in message
    news:11d301c5534c$00cf4250$a401280a@phx.gbl...
    > 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. #3
    Nick Hodge
    Guest

    Re: Locate and length functions

    Nigel

    Try the InStr() function

    InStr(1,"Nick Hodge","o")

    returns 7

    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS

    "Nigel Bennett" <nigelben@yahoo.com> wrote in message
    news:11d301c5534c$00cf4250$a401280a@phx.gbl...
    >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. #4
    Ken Valenti
    Guest

    RE: 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)
    >
    >


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0