EXCLUDE 0 FROM MIN

Leticia

New Member
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)))

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Fluff

MrExcel MVP, Moderator
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.

Leticia

New Member
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!

jasonb75

Well-known Member
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)``

Fluff

MrExcel MVP, Moderator

Can you have negative numbers in col G?

Leticia

New Member
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?

Replies
9
Views
204
Replies
3
Views
83
Replies
3
Views
241
Replies
0
Views
32
Replies
21
Views
659

1,137,059
Messages
5,679,368
Members
419,823
Latest member
Mercy kiara

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.

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

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