![]() |
#1
|
|||
|
|||
![]()
From A1 to A6:
4,0,5,1,2,3 Code:
=MIN(IF($A$1:$A$6<>0,IF($A$1:$A$6<>1,$A$1:$A$6))) Code:
=MIN(IF(AND($A$1:$A$6<>0,$A$1:$A$6<>1),$A$1:$A$6)) I'd like to ask how to make the second formula (use of AND) works. Many thanks! |
#2
|
||||
|
||||
![]()
Did you commit this array formula with Ctrl-Shift-Enter?
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#3
|
||||
|
||||
![]()
Simpler still:
=MIN(IF(($A$1:$A$6<>0)*($A$1:$A$6<>1),$A$1:$A$6)) or, if you can only have integers of 0 or more: =MIN(IF($A$1:$A$6>1,$A$1:$A$6)) either as an array formula.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
||||
|
||||
![]()
A non array solution
Code:
=SMALL(A1:a6,COUNTIF(A1:a6,0)+COUNTIF(A1:a6,1)+1)
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#5
|
|||
|
|||
![]()
Yes. Both of them.
|
#6
|
|||
|
|||
![]() Quote:
From A1 to A6: 4,0,5,1,2,1 Then Code:
COUNTIF($A$1:$A$6,1) ' will return 2 |
#7
|
|||
|
|||
![]() Quote:
But could I ask why mine with the use of the "AND" operator doesn't work? |
#8
|
||||
|
||||
![]()
Yes, and what is wrong about it? Aren't you looking for the smallest value different from 0 or 1 ?
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#9
|
||||
|
||||
![]()
I don't really understand why the AND operator doesn't work in this case, since what it's doing seems to me to be logically the same as the formula I posted.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#10
|
|||
|
|||
![]()
Nope. I've confused myself. You're right.
|
#11
|
|||
|
|||
![]() Quote:
Function AND have FALSE result, You can try Evaluate formula |
#12
|
|||
|
|||
![]()
AGGREGATE Function:
=AGGREGATE(15,6,A1:F1/((A1:F1<>0)*(A1:F1<>1)),1) |
![]() |
|