+ Reply to Thread
Results 1 to 4 of 4

Trim A Cell Only If It's 4 Characters Long

Hybrid View

  1. #1
    Registered User
    Join Date
    09-12-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Trim A Cell Only If It's 4 Characters Long

    ='[NFL Schedule.xlsx]2011'!$C$3

    When the above cell reference is applied it will return a result that is either 3 characters long or 4. If the result is 4 characters long, how can I rewrite this formula to ignore the first character and only return the next 3?

    For example: If the contents of C3 is @CAR the result returned will only be CAR.
    Last edited by mightyeskimo; 03-03-2012 at 11:56 AM.

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Trim A Cell Only If It's 4 Characters Long

    Maybe something like this:

    =IF('[Len(NFL Schedule.xlsx]2011'!$C$3)>3,Right('[NFL Schedule.xlsx]2011'!$C$3,3),'[NFL Schedule.xlsx]2011'!$C$3)
    abousetta
    Last edited by abousetta; 03-03-2012 at 11:40 AM. Reason: corrected formula
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Trim A Cell Only If It's 4 Characters Long

    You could probably even just use this:

    =Right('[NFL Schedule.xlsx]2011'!$C$3,3)
    without checking the length of the cell's contents.

    abousetta

  4. #4
    Registered User
    Join Date
    09-12-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Trim A Cell Only If It's 4 Characters Long

    Thanks abousetta!

+ 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