+ Reply to Thread
Results 1 to 8 of 8

#VALUE error when using MID

  1. #1
    Registered User
    Join Date
    08-20-2018
    Location
    Texas
    MS-Off Ver
    Office 365
    Posts
    52

    #VALUE error when using MID

    To get the numbers in separate cells, I am using the below code:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Sometimes Column E has only one number instead of two. When that happens, it is putting a space.

    Then I tell it to add F3 + G3, but I get an error message whenever there is one number instead of two numbers in Column E.

    Please Login or Register  to view this content.
    Error message: #VALUE!

    To get rid of the error, I have to manually delete the space.

    Is there a better way of doing this?
    Attached Files Attached Files

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: #VALUE error when using MID

    You want to get seconds digit from 1 digit number.
    As I see you wants to get 1st and 2nd digits, so you sure that numbers are <100.
    So i suggest instead of MID use LEFT and RIGHT.

    F2:
    Please Login or Register  to view this content.
    G2:
    Please Login or Register  to view this content.
    drag both down and results in column H are fine.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: #VALUE error when using MID

    How about =IFERROR($F2+$G2,"")
    HTH
    Regards, Jeff

  4. #4
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: #VALUE error when using MID

    ?
    F2 = choose(len($e2),$e2,left($e2,1))
    g2 = choose(len($e2),0,right($e2,1))
    ?

  5. #5
    Registered User
    Join Date
    08-20-2018
    Location
    Texas
    MS-Off Ver
    Office 365
    Posts
    52

    Re: #VALUE error when using MID

    KOKOSEK,

    Thanks! It is working!
    Last edited by jeffreybrown; 04-24-2019 at 06:48 PM. Reason: Removed full quote!

  6. #6
    Registered User
    Join Date
    08-20-2018
    Location
    Texas
    MS-Off Ver
    Office 365
    Posts
    52

    Re: #VALUE error when using MID

    Quote Originally Posted by jeffreybrown View Post
    How about =IFERROR($F2+$G2,"")
    No, this is not what I want. I don't want to ignore the error. Thanks.

  7. #7
    Registered User
    Join Date
    08-20-2018
    Location
    Texas
    MS-Off Ver
    Office 365
    Posts
    52

    Re: #VALUE error when using MID

    porucha vevrku,

    This works also! Thank you!
    Last edited by jeffreybrown; 04-24-2019 at 06:49 PM. Reason: Removed full quote!

  8. #8
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: #VALUE error when using MID

    Quote Originally Posted by lmcc007 View Post
    Error message: #VALUE!

    To get rid of the error, I have to manually delete the space.

    Is there a better way of doing this?
    Glad you found what you were seeking, but with your quote above, how was I to know you don't want to ignore the error.

    Also, please don't full quote everybody that responds.

+ 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. [SOLVED] Odd Error Handling Behaviour; goes to error handler even when no error?
    By kalikj in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-04-2018, 10:04 AM
  2. [SOLVED] Run-tim error -2147467259(80004005): Automation error Unspecidied error
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2014, 12:12 PM
  3. Excel macro (compile error. syntax error.) error
    By salar_younis in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2014, 06:11 AM
  4. Receiving following error “Complie error : syntax error” Help
    By masond3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2012, 10:19 AM
  5. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  6. Error 75 File/Path access error, sometimes Error 1004
    By smokebreak in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-16-2011, 02:35 PM
  7. [SOLVED] Error Handling - On Error GoTo doesn't trap error successfully
    By David in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-16-2006, 02:10 PM

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