Conditional Format - MIN, IF statements

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Cells F19 through F21 have values of 4.09, 3.70, and 3.77, respectively. F27
has a value of zero. I want to set up a formula in F100 that identifies the
lowest value in these 4 cells excluding values that are zero. The answer in
this case should be 3.70.

Can anyone help?

Thanks,
Bob
 
Array formula that must be entered using ctrl+shift+enter
=MIN(IF(G2:G22>0,G2:G22))
 
Either of the other two responses will work for you (change Don's ranges to
match Biff's) if there are no values in F22:F26; however, if there are
values there, then I'm not sure whether they can be modified, as posted, to
skip them. I'm sure there must be a better way but, off the top of my head,
the following formula seems to work...

=MIN(MIN(IF(F19:F21>0,F19:F21)),IF(F27>0,F27,1000))

Note this formula must be committed by pressing Ctrl+Shift+Enter.

The 1000 in the last number just needs to be a number that will be larger
than any possible entry into the cells being tested.

Rick
 
You don't need the 1000, Rick, you can just use

=MIN(MIN(IF(F19:F21>0,F19:F21)),IF(F27>0,F27))
 
Funny, I could swear I tried it without the 1000 and, when I did, the
formula returned 0; however, it is not doing that now. I must have screwed
up my original test somehow. Thanks for picking up on that.

Rick
 
I tried your formula. If F27 = 0, 0 is the result. The forumla evaluates to:
=MIN(3.7, FALSE) and Excel returns 0. If it is =MIN({3.7, FALSE}), Excel
returns 3.7
 
Excel help says that Excel ignores logical values if they are in array or
reference. If A1: =TRUE and A2: =FALSE, =MAX(A1:A2) = 0 and =MIN(A1:A2) = 0
whereas =MAX(TRUE, FALSE) = 1 and = MIN(TRUE, FALSE) = 0 So, TRUE amd FALSE
are not ignored when they are arguments to the function.
 
Hello Tyro,

Yes, you're right, I realised that after I posted.

Sorry, Rick, it was me who needed more testing not you!
 
I wonder why Excel is like that. It seems very inconsistent, and error prone
to me. Do all functions that ignore logical values in references or arrays,
take them into account if they are arguments in the same function?

Tyro
 
Back
Top