+ Reply to Thread
Results 1 to 8 of 8

If Right Left Query

Hybrid View

  1. #1
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,702
    Try

    =LEFT(A1,7-(RIGHT(A1)=1))

    If you want a - in there too

    =LEFT(A1,6)&IF(RIGHT(A1)=1,"","-"&RIGHT(A1))

  2. #2
    Registered User
    Join Date
    05-05-2006
    Location
    Kent, England
    Posts
    37
    Thanks daddy but it's failing on the =1

    even if I put >1 it does not work.

    for some reason it is not looking at the 7th digit and recognising it as equalling 1 (or greater than 1 when in input >1)....

    Any more ideas greatly appreciated

    Thank you very much

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,702
    see tony's solution.....or my revision..... Because RIGHT function returns text

    =RIGHT(A1) will never equal 1, it will be "1"

  4. #4
    Registered User
    Join Date
    05-05-2006
    Location
    Kent, England
    Posts
    37
    Legends the two of you!

    Many Thanks for the solution

    Have a GREAT DAY!

+ 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