PC Review


Reply
Thread Tools Rate Thread

How does this formula work ?

 
 
kittronald
Guest
Posts: n/a
 
      11th Jun 2011
Why does the following formula work the way it does ?

=MIN(IF({0,1,2,3}>0,{0,1,2,3}))

Using the Evaluate Formula dialog box, you see the IF test resolve
to {FALSE,TRUE,TRUE,TRUE}.

But the IF TRUE result returns {FALSE,1,2,3}.

How does this formula replace the 0 with FALSE and leave the
numbers unaffected ?


- Ronald K.
 
Reply With Quote
 
 
 
 
joeu2004
Guest
Posts: n/a
 
      11th Jun 2011
On Jun 10, 11:26*pm, kittronald <kittron...@yahoo.com> wrote:
> Why does the following formula work the way it does ?
> * * * =MIN(IF({0,1,2,3}>0,{0,1,2,3}))

[....]
> How does this formula replace the 0 with FALSE and leave
> the numbers unaffected ?


Every IF expression has two parts: value if true, and a value if
false. If the value-if-false is missing, it is implicitly FALSE.

So your MIN expression is effectively:

=MIN(IF({0,1,2,3}>0,{0,1,2,3},{FALSE,FALSE,FALSE,FALSE}))

Now, the operation of that expression is as if you wrote (but this is
not legal syntax):

=MIN({IF(0>0,0,FALSE),IF(1>0,1,FALSE},IF(2>0,2,FALSE),
IF((3>0,3,FALSE)})

Since 0>0 is false, that conceptual IF expression is replaced with the
value-if-false part, which is FALSE. Since 1>0, 2>0 and 3>0 are all
true, those conceptual IF expressions are replaced with the value-if-
true part, which 1, 2 and 3 respectively.

Thus, you effectively get the formula =MIN({FALSE,1,2,3}).

Now, looking at the MIN help page, you will see that MIN ignores logic
values. So the effect of the original MIN expression is return the
MIN of the values greater than zero, namely the MIN of 1, 2 and 3.
 
Reply With Quote
 
kittronald
Guest
Posts: n/a
 
      11th Jun 2011
Joe,

Thanks for the detailed explanation - now I understand a bit more.

However, I've been trying for days, with no avail, to get this
concept to work with the formula below:

Search for my post in this group for "Getting smallest number > 0
in an array constant".

- OR -

http://groups.google.com/group/micro...8835d828ae629a



-Ronald K.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
formula to work in a 3-d reference with 2 work books capt c Microsoft Excel Worksheet Functions 1 8th Apr 2009 08:04 PM
Sorting the cells of a formula causes the formula to not work Jake Microsoft Excel Worksheet Functions 3 31st Jan 2009 04:42 AM
A search for $ in a formula use to work now it does not work =?Utf-8?B?SnVuZUp1bHk=?= Microsoft Excel Misc 2 30th Nov 2005 10:13 PM
Can a formula work on another cells formula? whagopian Microsoft Excel Misc 1 4th Nov 2004 11:12 PM
extract a foldername with a formula-update formula does not work solo_razor Microsoft Excel Programming 2 30th Oct 2003 03:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:04 AM.