EXCLUDE 0 FROM MIN

Leticia

New Member
Joined
Jun 9, 2021
Messages
45
Office Version
  1. 365
Platform
  1. Windows
Hi, I am obtaining the min date given several conditions.
When one of the conditions is nonexistent, it gives me that one as the min value.
How can I solve that?

I am obtaining the =MIN(IF(MINIFS('EV80'!$G:$G;'EV80'!$P:$P;"OK";'EV80'!$G:$G;"<="&$F$4)>0;MINIFS('EV80'!$G:$G;'EV80'!$P:$P;"OK";'EV80'!$G:$G;"<="&$F$4));IF(MINIFS('EV80'!$G:$G;'EV80'!$G:$G;"<="&$F$4;'EV80'!$Q:$Q;">"&$F$4)>0;MINIFS('EV80'!$G:$G;'EV80'!$G:$G;"<="&$F$4;'EV80'!$Q:$Q;">"&$F$4)))

1624877678770.png
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
False equates to 0 which is why you are getting 0, try putting a very large number as the false part of both IF functions.
 
Upvote 0
False equates to 0 which is why you are getting 0, try putting a very large number as the false part of both IF functions.
It does work. But is there any other solution that does not involve putting random numbers? Thank you!
 
Upvote 0
is there any other solution that does not involve putting random numbers?
A large number inserted into the formula is not random, it is a deliberate value that is set higher than the scope of the real data so that it never produces an incorrect result.

If you insist on an alternative then this might work. I've assumed that the results of the 2 MINIFS functions can only be positive or zero, if you have negative numbers then it will need some additional criteria.
Excel Formula:
=AGGREGATE(15,6,CHOOSE({1;2};1/(1/MINIFS('EV80'!$G:$G;'EV80'!$P:$P;"OK";'EV80'!$G:$G;"<="&$F$4));1/(1/MINIFS('EV80'!$G:$G;'EV80'!$G:$G;"<="&$F$4;'EV80'!$Q:$Q;">"&$F$4)));1)
 
Upvote 0
Solution
Can you have negative numbers in col G?
 
Upvote 0
A large number inserted into the formula is not random, it is a deliberate value that is set higher than the scope of the real data so that it never produces an incorrect result.

If you insist on an alternative then this might work. I've assumed that the results of the 2 MINIFS functions can only be positive or zero, if you have negative numbers then it will need some additional criteria.
Excel Formula:
=AGGREGATE(15,6,CHOOSE({1;2};1/(1/MINIFS('EV80'!$G:$G;'EV80'!$P:$P;"OK";'EV80'!$G:$G;"<="&$F$4));1/(1/MINIFS('EV80'!$G:$G;'EV80'!$G:$G;"<="&$F$4;'EV80'!$Q:$Q;">"&$F$4)));1)
It worked! Thank you! If you can, could you explain me the logic behind?
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,107
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top