+ Reply to Thread
Results 1 to 12 of 12

#VALUE! display when a variable is missing in formula.

  1. #1
    Forum Contributor
    Join Date
    08-15-2005
    Location
    Oklahoma
    MS-Off Ver
    2010, 2013
    Posts
    112

    #VALUE! display when a variable is missing in formula.

    I am getting the #VALUE! display when a variable is missing in formula. In the formula =IF((J2+L2)=0," ",(K2*1000)/(J2+L2)), L2 is zero in many cases but K2 and J2 have values which are non-zero.

    Any suggestions?
    Last edited by Jim15; 01-25-2016 at 01:18 PM.
    Jim15

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: #VALUE! display when a variable is missing in formula.

    Hi Jim,
    It can be difficult without the data to understand the need. Try these two formula and see if they work for you.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    or

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Contributor
    Join Date
    08-15-2005
    Location
    Oklahoma
    MS-Off Ver
    2010, 2013
    Posts
    112

    Re: #VALUE! display when a variable is missing in formula.

    Attached is the Test Macro Buttons Excel spreadsheet and there are three (3) buttons currently used. Abstract, Annual and Monthly on the far left under Macros. If a field is blank, it gives the #VALUE! instead of the actual answer. According to some of the equations, I was expecting the fields to be calculated if a variable was missing and I understand the #DIV/0! I would prefer the #VALUE! to be calculated and the #DIV0! to be blank.

    Thanks!
    Attached Files Attached Files

  4. #4
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: #VALUE! display when a variable is missing in formula.

    I don't see any buttons or code.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  5. #5
    Forum Contributor
    Join Date
    08-15-2005
    Location
    Oklahoma
    MS-Off Ver
    2010, 2013
    Posts
    112

    Re: #VALUE! display when a variable is missing in formula.

    This is an add-in so how do I send that with an Excel file?

  6. #6
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: #VALUE! display when a variable is missing in formula.

    If you are in the visual basic editor you should be able to choose the add in project and see the code.

    You can upload the code.

  7. #7
    Forum Contributor
    Join Date
    08-15-2005
    Location
    Oklahoma
    MS-Off Ver
    2010, 2013
    Posts
    112

    Re: #VALUE! display when a variable is missing in formula.

    Please Login or Register  to view this content.
    Last edited by Jim15; 01-21-2016 at 05:03 PM.

  8. #8
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: #VALUE! display when a variable is missing in formula.

    Jim you have quite a few posts, so I'm going to have to insist you use code tags. Go to your last post, choose the edit button, select all the code text and click the # button on the toolbar. This will put code tags at the beginning and end of your code. Choose to save the changes and your code will look like mine below.

    Please make this a habit when posting code.

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    08-15-2005
    Location
    Oklahoma
    MS-Off Ver
    2010, 2013
    Posts
    112

    Re: #VALUE! display when a variable is missing in formula.

    Finished adding code tags and thanks for the tip. There are two (2) macros in the code Prod_Abstract and Prod_Annual. Prod_Annual is cleaner and more succinct whereas Prod_Abstract is a recorded macro.


  10. #10
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: #VALUE! display when a variable is missing in formula.

    You have an empty string in your cells which is causing the errors in your formulas.

    In other words the cells are not blank, it's the equivalent of clicking into a cell and pushing the space bar and hitting enter.

    When I click into a cell that looks empty and hit the delete key, removing the empty string, the formula works fine.

  11. #11
    Forum Contributor
    Join Date
    08-15-2005
    Location
    Oklahoma
    MS-Off Ver
    2010, 2013
    Posts
    112

    Re: #VALUE! display when a variable is missing in formula.

    Thanks. Is there VBA code that I can add that will remove the empty strings?

  12. #12
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: #VALUE! display when a variable is missing in formula.

    btw all your sum() functions are unnecessary
    Josie

    if at first you don't succeed try doing it the way your wife told you to

+ 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-27-2014, 12:54 PM
  2. Display values that are missing from a spreadsheet
    By antrobus in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-10-2013, 08:10 AM
  3. Replies: 1
    Last Post: 10-27-2012, 02:54 AM
  4. Macro solving for missing variable
    By myfe in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-02-2012, 03:18 PM
  5. Excel 2007 : What variable am I missing here?
    By rotdog308 in forum Excel General
    Replies: 7
    Last Post: 04-28-2011, 04:41 PM
  6. How do I solve for a missing variable?
    By dtevol in forum Excel General
    Replies: 1
    Last Post: 05-27-2008, 01:34 PM
  7. Display missing names
    By scabertrain in forum Excel General
    Replies: 1
    Last Post: 10-09-2007, 02:19 PM
  8. What variable do you insert for X-cel if there is missing data?
    By Iop.kcl in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 03-22-2005, 01:06 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