+ Reply to Thread
Results 1 to 4 of 4

Dynamic LEFT function help

  1. #1
    Registered User
    Join Date
    06-09-2016
    Location
    Denver
    MS-Off Ver
    07
    Posts
    1

    Dynamic LEFT function help

    Hi there,

    New to the forum, hopefully someone has experience with this and will be able to help. I have a list of about 10,000 websites all ending in different domains (com, org, biz, fr, cc, etc, etc), I also have a list of every domain ending possible. My question is how to adapt this left function which is used to remove everything after .com (ex: www.something.com/something to www.something.com) LEFT(D2,FIND("com",D2)+2) such that instead of using the hardcoded 'com' it can simply reference the table I have with all domain endings?

    Thanks in advance

    Max

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Dynamic LEFT function help

    I guess it's not as easy as returning everything to the left of the slash / ?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Dynamic LEFT function help

    If you have a list of all your 'www.somethings.com' in say G1:G20 for example
    And A1 is the whole string

    Try
    =LOOKUP(2^15,SEARCH($G$1:$G$20,A1),$G$1:$G$20)


    Note, there cannot be any blanks in your list of somethings.com (G1:G20)

  4. #4
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Dynamic LEFT function help

    I went with something like this:

    =LEFT(A1,SEARCH(INDEX($P$1:$P$5,MAX(IF(ISERROR(FIND($P$1:$P$5,A1)),-1,1)*(ROW($P$1:$P$5)-ROW($P$1)+1))),A1)+2)

    With your list of endings in P1:P5. See attached for details. Tony raises a good point, though.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Embed left function in match/index function
    By Kyle18 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-12-2016, 05:17 AM
  2. [SOLVED] Dynamic formatting based on the cell to the left
    By Diablous89 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-29-2014, 07:28 PM
  3. [SOLVED] IF Function referencing IsNumber, Match, Left function on separate sheets
    By Touch9713 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-12-2013, 10:09 PM
  4. [SOLVED] How to use custom sort while sorting left to right for entire dynamic used range
    By herbie226 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-05-2012, 11:58 PM
  5. Using LEFT with OFFSET to get a dynamic drop down list
    By alcopoppa in forum Excel General
    Replies: 6
    Last Post: 01-20-2012, 08:53 AM
  6. HOW DO I NEST THE VLOOKUP FUNCTION WITH THE LEFT FUNCTION
    By CHAIM in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  7. [SOLVED] HOW DO I NEST THE VLOOKUP FUNCTION WITH THE LEFT FUNCTION
    By CHAIM in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM

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