+ Reply to Thread
Results 1 to 5 of 5

Inherited formula uses multiplication strangely

  1. #1
    Registered User
    Join Date
    03-21-2013
    Location
    Albany, NY
    MS-Off Ver
    Excel 2010
    Posts
    2

    Inherited formula uses multiplication strangely

    Hello - I have inherited a workbook and am figuring it out. The below formula works as intended but I do not understand why. Specifically, I do not understand the use of multiplication in the first argument.

    =IF((Sheet1'!F7=0)*(Sheet1'!F8=0),"", IF(Sheet1'!F7=0,"Please Enter Data for All Zones", IF(Sheet1'!F8=0,"Please Enter Data for All Zones", Sheet1'!F7+Sheet1'!F8)))

    F7 and F8 are two zones in the same region; if a user enters data for any zone in a region then they need to enter all zones in that region. If they enter none, the summary can remain blank. The formula displays the intended blank, message, and sum accordingly, but I do not understand the first statement using * to multiply the two empty fields. Excel seems to treat this as AND, returning the blank "" when both cells are empty, not as zero times something equals zero as I would expect multiplication to do when only one cell is empty.

    Any explanation would be much appreciated. Thank you!
    Last edited by meierrain; 08-05-2014 at 02:32 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Inherited formula uses multiplication strangely

    In array formulas, "*" is understood to mean "and". So, it's understood to mean: =IF((Sheet1'!F7=0)AND(Sheet1'!F8=0)","",...

  3. #3
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Inherited formula uses multiplication strangely

    More specifically..

    (Sheet1'!F7=0)*(Sheet1'!F8=0)

    Sheet1'!F7=0 is an expression (or question) with a true or false answer.
    Is F7 equal to 0, true or false.

    Same for Sheet1'!F8=0

    so you end up with one of the following 4 possible combinations.
    (true)*(true)
    (true)*(false)
    (false)*(false)
    (false)*(true)

    Now, performing math operations on True or False values converts those to 1's or 0's.
    True = 1
    False = 0
    So they become
    (1)*(1) = 1
    (1)*(0) = 0
    (0)*(0) = 0
    (0)*(1) = 0

    So the result of
    (Sheet1'!F7=0)*(Sheet1'!F8=0)
    Will only be either 1 or 0.
    And it will only be 1 if both expressions(questions) are TRUE.


    Now the IF normally expects a True or False value in it's expression.
    But that can be substituted with 1 or 0
    Again, 1 = True, 0 = False

    And reallly, in the IF, 0 is False and ANY other number is TRUE.


    Hope that helps.

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Inherited formula uses multiplication strangely

    Quote Originally Posted by Jonmo1 View Post
    And reallly, in the IF, 0 is False and ANY other number is TRUE.
    And that is very useful to know.

    This ends up working like an AND
    (Sheet1'!F7=0)*(Sheet1'!F8=0)

    You could change the * to + to make it an OR
    (Sheet1'!F7=0)+(Sheet1'!F8=0)

    Now the results can be 0 1 or 2
    0 is false, any other number is true.

  5. #5
    Registered User
    Join Date
    03-21-2013
    Location
    Albany, NY
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Inherited formula uses multiplication strangely

    Thank you, Jonmo1. That helps enormously.

+ 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. Inherited Complex Formula, Need Assistance to Change
    By DHartwig35805 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-22-2013, 04:29 PM
  2. [SOLVED] VBA Multiplication Formula
    By hobbiton73 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-19-2013, 04:32 AM
  3. IF formula behaving strangely in certain cells
    By gramomster in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-09-2013, 12:15 PM
  4. What formula to use the multiplication
    By macroashraf in forum Excel General
    Replies: 5
    Last Post: 05-24-2012, 10:36 AM
  5. Multiplication formula
    By yuvosh in forum Excel General
    Replies: 5
    Last Post: 03-05-2007, 08:05 AM

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