+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17

Thread: find the third space after an ampersand in cell

  1. #16
    Forum Contributor
    Join Date
    09-19-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    136

    The Formula You Typed Contains Errors

    =IF(ISERR(FIND("&",A1,1)),"",IF(AND(ISERROR(FIND(",",A1)),IF(ISNUMBER(FIND("&",A1)))),ERROR OCCURS HERE,LEFT(A1,FIND("&",A1,1)-1)))



    Where I say error occurs here, this is what's there:

    LEFT(B3,FIND(",",B3&",")-1)&","&RIGHT(B3,LEN(B3)-FIND("&",B3&"&")),RIGHT(B3,LEN(B3)-SEARCH("@",SUBSTITUTE(B3," ","@",LEN(B3)-LEN(SUBSTITUTE(B3," ",""))))&", "&SUBSTITUTE(RIGHT(B3,LEN(B3)-FIND("&",B3&"&")-1),RIGHT(B3,LEN(B3)-SEARCH("@",SUBSTITUTE(B3," ","@",LEN(B3)-LEN(SUBSTITUTE(B3," ",""))))),""))

    which turns this:
    KNUD J & MARIA L HOSTRUP

    into this:
    HOSTRUP,MARIA L

    All it's supposed to do is if no ampersand, return empty cell, if no comma but ampersand exists, then the code which is containing errors right now and excel isn't telling me what problem is, and if there is no ampersand but there is a comma so we just return LEFT(A1,FIND("&",A1,1)-1).

  2. #17
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,006

    Re: find the third space after an ampersand in cell

    here is the file I did the working in, highlighted in yellow at the right are the final formulas, and to the left highlighted in yellow are the parial formulas used to construct the one formula!
    Attached Files Attached Files
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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