Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-26-2015, 03:38 AM
tinfanide tinfanide is offline Need help with MIN IF AND Windows 7 64bit Need help with MIN IF AND Office 2010 32bit
Expert
Need help with MIN IF AND
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default Need help with MIN IF AND

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)))
This formula, with the use of nested IF, works. (Return: 2)

Code:
=MIN(IF(AND($A$1:$A$6<>0,$A$1:$A$6<>1),$A$1:$A$6))
This formula, with the use of AND inside IF, does not work. (Return: 0)

I'd like to ask how to make the second formula (use of AND) works.

Many thanks!
Reply With Quote
  #2  
Old 06-26-2015, 05:00 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Need help with MIN IF AND Windows 7 64bit Need help with MIN IF AND Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,920
Pecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond repute
Default

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
Reply With Quote
  #3  
Old 06-26-2015, 05:12 AM
macropod's Avatar
macropod macropod is offline Need help with MIN IF AND Windows 7 64bit Need help with MIN IF AND Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,369
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #4  
Old 06-26-2015, 07:33 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Need help with MIN IF AND Windows 7 64bit Need help with MIN IF AND Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,920
Pecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond repute
Default

A non array solution
Code:
=SMALL(A1:a6,COUNTIF(A1:a6,0)+COUNTIF(A1:a6,1)+1)
EDIT corrected typo
__________________
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
Reply With Quote
  #5  
Old 06-27-2015, 06:13 AM
tinfanide tinfanide is offline Need help with MIN IF AND Windows 7 64bit Need help with MIN IF AND Office 2010 32bit
Expert
Need help with MIN IF AND
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Quote:
Originally Posted by Pecoflyer View Post
Did you commit this array formula with Ctrl-Shift-Enter?
Yes. Both of them.
Reply With Quote
  #6  
Old 06-27-2015, 06:29 AM
tinfanide tinfanide is offline Need help with MIN IF AND Windows 7 64bit Need help with MIN IF AND Office 2010 32bit
Expert
Need help with MIN IF AND
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Quote:
Originally Posted by Pecoflyer View Post
A non array solution
Code:
=SMALL(A1:a6,COUNTIF(A1:a6,0)+COUNTIF(A1:a6,1)+1)
EDIT corrected typo
Thanks. But if the array is like this:

From A1 to A6:
4,0,5,1,2,1

Then

Code:
COUNTIF($A$1:$A$6,1)
' will return 2
Reply With Quote
  #7  
Old 06-27-2015, 07:18 AM
tinfanide tinfanide is offline Need help with MIN IF AND Windows 7 64bit Need help with MIN IF AND Office 2010 32bit
Expert
Need help with MIN IF AND
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
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.
Yes, with the use of asterisk, it works.
But could I ask why mine with the use of the "AND" operator doesn't work?
Reply With Quote
  #8  
Old 06-27-2015, 09:22 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Need help with MIN IF AND Windows 7 64bit Need help with MIN IF AND Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,920
Pecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond repute
Default

Quote:
Originally Posted by tinfanide View Post
Thanks. But if the array is like this:

From A1 to A6:
4,0,5,1,2,1

Then

Code:
COUNTIF($A$1:$A$6,1)
' will return 2
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
Reply With Quote
  #9  
Old 06-27-2015, 09:15 PM
macropod's Avatar
macropod macropod is offline Need help with MIN IF AND Windows 7 64bit Need help with MIN IF AND Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,369
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by tinfanide View Post
could I ask why mine with the use of the "AND" operator doesn't work?
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]
Reply With Quote
  #10  
Old 06-27-2015, 09:53 PM
tinfanide tinfanide is offline Need help with MIN IF AND Windows 7 64bit Need help with MIN IF AND Office 2010 32bit
Expert
Need help with MIN IF AND
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default

Quote:
Originally Posted by Pecoflyer View Post
Yes, and what is wrong about it? Aren't you looking for the smallest value different from 0 or 1 ?
Nope. I've confused myself. You're right.
Reply With Quote
  #11  
Old 06-27-2015, 11:18 PM
beginner beginner is offline Need help with MIN IF AND Windows 7 32bit Need help with MIN IF AND Office 2013
Advanced Beginner
 
Join Date: Sep 2011
Location: Europe
Posts: 45
beginner will become famous soon enough
Default

Quote:
Originally Posted by tinfanide View Post
This formula, with the use of AND inside IF, does not work. (Return: 0)
...
But could I ask why mine with the use of the "AND" operator doesn't work?
I hope that you can help explanation of the picture below
Function AND have FALSE result, You can try Evaluate formula
Attached Images
File Type: png min-if-and.png (14.1 KB, 16 views)
Reply With Quote
  #12  
Old 06-28-2015, 12:43 AM
Kevin@Radstock Kevin@Radstock is offline Need help with MIN IF AND Windows 8 Need help with MIN IF AND Office 2013
Office 365
 
Join Date: Feb 2012
Posts: 94
Kevin@Radstock is on a distinguished road
Default

AGGREGATE Function:

=AGGREGATE(15,6,A1:F1/((A1:F1<>0)*(A1:F1<>1)),1)
Reply With Quote
Reply



Other Forums: Access Forums

All times are GMT -7. The time now is 10:32 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft