Leticia

New Member
Joined
Jun 9, 2021
Messages
37
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

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
Joined
Jun 12, 2014
Messages
60,265
Office Version
  1. 365
Platform
  1. Windows
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
Joined
Jun 9, 2021
Messages
37
Office Version
  1. 365
Platform
  1. Windows
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
Joined
Dec 30, 2008
Messages
13,223
Office Version
  1. 365
Platform
  1. Windows
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)
 
Solution

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
60,265
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

Can you have negative numbers in col G?
 

Leticia

New Member
Joined
Jun 9, 2021
Messages
37
Office Version
  1. 365
Platform
  1. Windows
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?
 

Forum statistics

Threads
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.
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
Top