+ Reply to Thread
Results 1 to 6 of 6

Formula won't calculate when only some of the three variables are input

  1. #1
    Registered User
    Join Date
    12-19-2008
    Location
    CA
    Posts
    64

    Formula won't calculate when only some of the three variables are input

    In column H:
    =IF(ISERROR(L4-J4-K4),"",IF(OR(K4="0", K4=""), L4-J4, L4-J4-K4))
    So, if formula is going to come up with an error, I don't need to know.

    If it's not an error: L - J - K

    Except that sometimes there isn't information in J or K, and the formula won't calcluate L - 0 - 0, unless I physically enter in zeros.

    Turning the Zeros on under options doesn't help.
    Forced (F9) or automatic calculation doesn't help.

    I've also tried this formula
    =IF(ISERROR(L4-J4-K4),"",IF(K4=""), L4-J4, L4-J4-K4))
    and
    =IF(ISERROR(L4-J4-K4),"", L4-J4-K4))
    I don't want the people using this to have to enter in a plethora of zeros in order to force the calculation. What am I doing wrong?

    I've attached workbook with the relevant information in it. You can see in the middle that if there is nothing entered, it won't work right.
    Attached Files Attached Files
    Last edited by Lizabeta; 07-28-2009 at 12:22 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula won't calculate when only some of the three variables are input

    formula is ok but there is text in c7 "^" clear the cells with delete
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    12-19-2008
    Location
    CA
    Posts
    64

    Re: Formula won't calculate when only some of the three variables are input

    When I download and open the file I see no text in C7

    And B7, B8 and B9 won't calculate unless you enter a number or 0 into C7, C8 or C9, respectively.
    Last edited by Lizabeta; 07-27-2009 at 07:40 PM.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula won't calculate when only some of the three variables are input

    Try select column J and go to Data|Text to Columns and click Finish.

    Repeat for column K and then for column L.

    Then change the "0" in the formula to 0 without quotes...

    e.g.

    =IF(ISERROR(L4-J4-K4),"",IF(OR(K4="", K4=0), L4-J4, L4-J4-K4))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  5. #5
    Registered User
    Join Date
    12-19-2008
    Location
    CA
    Posts
    64

    Re: Formula won't calculate when only some of the three variables are input

    NBVC,

    That worked!

    If you have a minute, I'd love to know why it worked! :-)
    Someday, I dream of not having to ask so many questions!
    Thank you!!

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula won't calculate when only some of the three variables are input

    Those columns were somehow preformatted as text and so the numbers were actually text.

    The Text to Columns (skipping to third window and setting column data format to General) resets the columns to general format (which makes numbers numbers). If you just hit finish at the start it is the same effect since General is default.

    Then in the formula you have the 0 in quotes making it a text string, not numeric.

+ 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