Forum Discussion
Fecha maxima con condiciones
- Oct 17, 2021
Hola, en su hoja de cálculo de Excel, las celdas D3, D4 y D5 tienen las letras X, Y y Z.
Acabo de darme cuenta de que las fórmulas no dan el resultado correcto. Desafortunadamente, no puedo mostrarle una solución para Excel 2016.
Sorry that i missed you work with Excel 2016. I work with Excel 2013 and i can use formula below (however when i am online in my Microsoft account i can work with many of the new excel functions in addition):
=IF(AND(COUNTIF($B$2:$B$15;D3)>COUNTIF($B$2:$B$15;D4);INDEX($A$1:$A$15;MIN(IF($B$2:$B$15=D3;ROW($A$2:$A$15))))>INDEX($A$1:$A$15;MIN(IF($B$2:$B$15=D4;ROW($A$2:$A$15)))));D3;IF(AND(COUNTIF($B$2:$B$15;D4)>COUNTIF($B$2:$B$15;D5);INDEX($A$1:$A$15;MIN(IF($B$2:$B$15=D4;ROW($A$2:$A$15))))>INDEX($A$1:$A$15;MIN(IF($B$2:$B$15=D5;ROW($A$2:$A$15)))));D4;"N"))
I have to enter formula as matrix with ctrl+shift+enter. Maybe you have to replace " ; " by " ," depending on your version of excel.
Formula returns 1 result. If X>Y and Y>Z are both true, X is returned.
I can also use formula below:
=IF(AND(COUNTIF(B2:B15;D4)>COUNTIF(B2:B15;D5);VLOOKUP(D4;CHOOSE({1.2};B2:B15;A2:A15);2;0)>VLOOKUP(D5;CHOOSE({1.2};B2:B15;A2:A15);2;0));D4;IF(AND(COUNTIF(B2:B15;D3)>COUNTIF(B2:B15;D4);VLOOKUP(D3;CHOOSE({1.2};B2:B15;A2:A15);2;0)>VLOOKUP(D4;CHOOSE({1.2};B2:B15;A2:A15);2;0));D3;""))