+ Reply to Thread
Results 1 to 5 of 5

Search and Left Function

  1. #1
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293

    Search and Left Function

    Hello,

    On row A, I have data such as http://www.dafsdfasfd.com/dfsfdds.php?=dsfsd

    etc.

    What I want to do is have excel display only result up to and including first "/", so desired result would be, http://www.dafsdfasfd.com/

    the formula I tried, without success was , =AND(SEARCH("/",A5),LEFT(A5,"/"))


    any idea how to fix, thanks in advance. i've attached a sample file for reference
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    If they all start with http://
    you can use

    =LEFT(A2,SEARCH("/",MID(A2,8,LEN(A2)))+6)
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293
    thanks bud worked perfectly few questions, one why did you use 8? for MID(A2,8,LEN(A2)))+6)

    also could you perhaps translate in plain english, as far as I understand it,

    i.e. search for "/", starting in cell a2 (MID),starting at position 8, by +6 characters (hence, LEN(A2)))+6), all to the left of original search "/"


    i know I botched that up

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    try this formula it is much simpler

    =LEFT(A2,SEARCH("/",A2,8)-1)

    it starts search at 8th carracter so the 2 // of http:// are not included

  5. #5
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293
    thanks bud/mudraker...2nd formula makes sense to my newbie excel head. I really appreciate you taking the time to help me.

+ Reply to Thread

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.6.0 RC 1