+ Reply to Thread
Results 1 to 4 of 4

Error in IF formula with space

  1. #1
    Registered User
    Join Date
    12-03-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    63

    Error in IF formula with space

    Hi Friends,

    I have a 'Input Column', where user will enter the data. The column can have following three scenario
    1) Blank,
    2) Numeric with 'Hyphen' (example : 603160-Communications-Other)
    3) Numeric with no 'Hyphen' (example : 603160)

    I am using formula =IF(B4="","",TRIM((LEFT(B4,FIND("-",B4)-1)))). In this cell B4 has the text/value. The formula works well for 1st and 2nd. But I get #VALUE! in the 3rd scenario.

    Kindly advice how to correct the formula.

    Thanks

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,487

    Re: Error in IF formula with space

    Maybe
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    12-03-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    63

    Re: Error in IF formula with space

    Thanks Trevor. This solution works!!

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,487

    Re: Error in IF formula with space

    You're welcome. Thanks for the rep.

+ 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. out of stack space error
    By bezbid in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-02-2019, 06:13 PM
  2. [SOLVED] Error 28 Stack Space
    By scrabtree23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2015, 09:58 AM
  3. VBA Out of Stack Space Error 28
    By alexcapewell in forum Excel General
    Replies: 9
    Last Post: 10-13-2015, 07:01 AM
  4. Out of stack space error
    By lazyengineer in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-10-2015, 02:24 PM
  5. Replies: 6
    Last Post: 03-14-2015, 08:23 AM
  6. Error 14. Out of string space.
    By sumdumgai in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-10-2015, 11:19 PM
  7. Out of stack space error
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-20-2008, 03:47 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