+ Reply to Thread
Results 1 to 7 of 7

IF functions not calculating

  1. #1
    Registered User
    Join Date
    05-08-2013
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2011 mac
    Posts
    44

    IF functions not calculating

    I have a series of IF functions calculating on the basis of certain cells. Eg:

    =IF(BBR54=".",".",IF(AND(BBR54="1",BBR56="1"),"1",0))

    On checking the results, I have found that for certain columns, some of the calculations are NOT calculating. That is, if the IF calc criteria are met, I'd expect a '1' returned, but sometimes it isn't. However, if I input '1' into the source cells, then the calculation works as expected.

    I have tried using source/calc cells as numbers or as text (as in the calc above). Neither always works. Lastly, I have tried copying source cells and pasting them, but no improvement.

    Any ideas?
    Last edited by tays01s; 02-22-2024 at 12:02 PM.

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: IF functions not calculating

    Could it be that your 1s are numeric and not text?
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: IF functions not calculating

    It looks like a fairly simple decision tree with three possible outcomes:

    Outcome 1) If BBR54 is ".", then return ".".
    Outcome 2) If BBR54 and BBR56 are both "1", then return "1".
    Outcome 3) Any other condition, then return 0.

    Is that an accurate description of the intended decision tree? When the decision tree fails, what are the exact values of BBR54 and BBR56? What value is returned? What value did you expect?

    For something like this, I would expect the "Evaluate formula" tool to be a useful debugging tool: https://support.microsoft.com/en-us/...rs=en-us&ad=us
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    05-08-2013
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2011 mac
    Posts
    44

    Re: IF functions not calculating

    Answers to Qs"
    When the decision tree fails, what are the exact values of BBR54 and BBR56?
    Both 1. As mentioned, I've tried source as both text, as for this formula and number, when the values looked for are "1"

    What value is returned?
    0

    What value did you expect?
    1

    I will check out Evaluate to debug.

  5. #5
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: IF functions not calculating

    You could reduce the problem of "1" becoming 1 by using the formula bellow.

    =IF(BBR54=".",".",IF(AND(--BBR54=1,--BBR56=1),"1",0))

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: IF functions not calculating

    When the decision tree fails, what are the exact values of BBR54 and BBR56? Both 1.
    Insufficient. Stating that both cells contain a 1 does not go far enough to describe exactly what is in those cells. It's already been mentioned, but are they 1 stored as text or are they 1 stored as a number (ISTEXT() and ISNUMBER() can be useful functions for determining which data type is being stored)? If they are 1 stored as text, are there any extraneous, invisible characters (space or carriage return or some such)? I find LEN(), CODE(), MID(), and similar text functions useful for determining if there are extraneous invisible characters. If they are 1 stored as a number, is the value exactly 1.00000000....., or is it a value that is not exactly 1 but close enough to 1 to be displayed as 1 according to the display parameters (cell width and number format and such)?

    If Excel is choosing to return 0 with this function, then something about the ones stored in the cells and the 1.00000000000000 number you've hardcoded in the function is different. Debugging this sort of thing is all about finding that difference.

  7. #7
    Registered User
    Join Date
    05-08-2013
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2011 mac
    Posts
    44

    Re: IF functions not calculating

    Evaluate showed that the "IF(AND(BBR54="1",BBR56="1"" component was FALSE when it should have been TRUE. There was even an "NA" in there.

    Solution: Despite converting source array to 'number' failing, if you find 1 and replace with 1 specifying number, that fixes it and the calc works.

+ 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. Help with calculating monthly commissions- IF and AND functions
    By rostolaza in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-06-2019, 10:00 PM
  2. Replies: 7
    Last Post: 11-29-2018, 08:53 PM
  3. Permutation Functions for calculating ALL possibilities
    By Apcal88 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-17-2015, 12:18 PM
  4. Calculating Proportional allocation using nested IF functions
    By Rob Ardill in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 11-20-2013, 02:49 AM
  5. [SOLVED] Calculating a sum of many IF(INDEX) functions
    By BHammy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2012, 11:31 AM
  6. How to use functions for calculating dates of other cells
    By TooNisExcelled in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-21-2011, 09:08 PM
  7. [SOLVED] Functions not re calculating automatically
    By cjv in forum Excel General
    Replies: 3
    Last Post: 07-28-2005, 04:05 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