+ Reply to Thread
Results 1 to 9 of 9

Help on "IF", "FIND", "SUBSTITUTE", & "LEFT/RIGHT" FUNCTIONS

  1. #1
    Registered User
    Join Date
    02-20-2018
    Location
    MONCTON
    MS-Off Ver
    2010
    Posts
    4

    Question Help on "IF", "FIND", "SUBSTITUTE", & "LEFT/RIGHT" FUNCTIONS

    I have very long address data and trying to clean up
    my address column looks like
    Q:
    13 ABC LANE NE
    PO BOX XXX MM NK
    XX STREET PENA PE
    10TH CROSS

    Ans:
    13 ABC LANE
    PO BOX XXX MM
    XX STREET PENA
    10TH CROSS

    I am trying to removed only last word "NE", "NK", "PE" from the text(if text have). I used formula =LEFT(A1,LEN(A1)-2), This formula worked on first three row but did not work on 4th row (10TH CRO). I used =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"NE",""),"NK",""),"PE","") but it did not work, remove NE from LANE and PE from PENA.

    So I am looking to combine few excel function together: IF text possess "NE", "NK", "PE" as last word from LEFT, FIND and SUBSTITUTE as blank ("") or REMOVE, otherwise leave it as A1.

    Any suggestion. Much appreciated.

    Thanks

  2. #2
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Help on "IF", "FIND", "SUBSTITUTE", & "LEFT/RIGHT" FUNCTIONS

    Please Login or Register  to view this content.
    Try this
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  3. #3
    Registered User
    Join Date
    02-20-2018
    Location
    MONCTON
    MS-Off Ver
    2010
    Posts
    4

    Re: Help on "IF", "FIND", "SUBSTITUTE", & "LEFT/RIGHT" FUNCTIONS

    This formula did not work correctly on row 3.

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Help on "IF", "FIND", "SUBSTITUTE", & "LEFT/RIGHT" FUNCTIONS

    Try this:

    =IF(OR(RIGHT(A1,3)={" NE"," NK"," PE"}),LEFT(A1,LEN(A1)-3),A1)

  5. #5
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Help on "IF", "FIND", "SUBSTITUTE", & "LEFT/RIGHT" FUNCTIONS

    how about this...
    =IF(OR(RIGHT(A1,2)="ne",RIGHT(A1,2)="nk",RIGHT(A1,2)="pe"),LEFT(A1,LEN(A1)-2),A1)
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  6. #6
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Help on "IF", "FIND", "SUBSTITUTE", & "LEFT/RIGHT" FUNCTIONS

    =if(left(right(a1,3),1)=" ",left(a1,len(a1)-3),a1)

  7. #7
    Registered User
    Join Date
    02-20-2018
    Location
    MONCTON
    MS-Off Ver
    2010
    Posts
    4

    Re: Help on "IF", "FIND", "SUBSTITUTE", & "LEFT/RIGHT" FUNCTIONS

    working.

  8. #8
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Help on "IF", "FIND", "SUBSTITUTE", & "LEFT/RIGHT" FUNCTIONS

    if you got it resolved don't forget to mark this post as solved using the thread tools dropdown at the top of this post and since you are new it is nice to thank any or all of those who stopped by to help you resolved the issue.
    oh, and thank you for the rep too!

  9. #9
    Registered User
    Join Date
    02-20-2018
    Location
    MONCTON
    MS-Off Ver
    2010
    Posts
    4

    Re: Help on "IF", "FIND", "SUBSTITUTE", & "LEFT/RIGHT" FUNCTIONS

    Much appreciated every efforts to solve this q.
    thank you

+ 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. Replies: 5
    Last Post: 02-05-2019, 12:03 AM
  2. Replies: 2
    Last Post: 07-24-2017, 02:19 AM
  3. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  4. Replies: 35
    Last Post: 01-13-2016, 02:16 AM
  5. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  6. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  7. Replies: 5
    Last Post: 06-26-2006, 09:23 PM

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