Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Raju Iyer   on Aug 24 In MS Office Category.

  
Question Answered By: Woodrow Jones   on Aug 24

Another way of looking at this if/then function:
B4=IF(B1>B2,B1- B2,��)
is to use the logical  result of the comparison  (B1>B2) and multiply it against
(B1-B2)....

B4=(B1>B2) * (B1-B2)

From a worksheet perspective:
When the condition  (B1>B2) is true: (7>5),
the boolean result of 'True' is functionally =1.
When the condition (B1>B2) is false: (5>7)
the boolean result of 'False' is functionally =0.
When the condition (B1>B2) is false: (5>5)
the boolean result of 'False' is functionally =0.

So, you'll return the 2 logical/numeric conditions/expressions:
B4= (1)*(B1-B2)
or
B4=(0)*B1-B2)

Share: