问题
I want the Youngest White cat's date from the excel table below to be displayed in a cell. The youngest would be born 29/07/2015.
In another cell i want to display the oldest white cat date 18/07/2015.
Column A ->Animal Column B ->Color Column C ->Date of birth
I know the formula if its is for one cell
=IF(AND(A1="CAT",B1="White"),C1)
RowNo------A-----B--------C-----
1------- CAT White 20/07/2015
2--------CAT White 29/07/2015
3--------CAT White 18/07/2015
4--------DOG Black 29/07/2015
5--------COW White 29/07/2015
6--------CAT White 20/07/2015
7--------COW Black 29/07/2015
8--------COW Black 29/07/2015
回答1:
You can quickly get the pseudo-MINIF or pseudo-MAXIF using the newer AGGREGATE function.
The formulas in G2:H2 are,
=AGGREGATE(14, 6, ($A$2:$A$99=E2)*($B$2:$B$99=F2)*($C$2:$C$99), 1)
=AGGREGATE(15, 6, 1/($A$2:$A$99=E2)*($B$2:$B$99=F2)*($C$2:$C$99), 1)
There are a host of MINIF and MAXIF formulas out there but few that use AGGREGATE. This is a powerful new(er) function and deserves some attention.
This is a standard non-array formula that does NOT require Ctrl+Shift+Enter↵. AGGREGATE was introduced with Excel 2010. For pre-2010 solutions you can refer to MINIF, MAXIF and MODEIF.
回答2:
Pivot the data with animal and colour in FILTERS and date of birth in VALUES twice (Max and Min):
来源:https://stackoverflow.com/questions/31711671/two-criteria-minif-and-maxif-formula