top of page

Alinear tabla Problema con tabla Resultado

Debemos de alinear la tabla Problema con la tabla Resultado.


La cantidad de la tabla de resultados es la suma de la cantidad de la tabla de problemas.


Ordenamos alfabéticamente los pájaros de la tabla de resultados.












En la celda H2, ponemos LET, creamos una variable, seleccionamos el rango B1:F8.


Creamos otra variable, ponemos la funcion ESTEXTO, como argumento valor ponemos la variable “xx”.


Probamos variable.


=LET(xx;B1:F8;a;ESTEXTO(xx);a)


Obtenemos una matriz desbordada con VERDADERO donde es texto, y, FALSO donde no lo es.











Preguntamos si el resultado de ESTEXTO es igual a VERDADERO, en ese caso, que nos devuelva el rango el rango B1:F8, en caso contrario, que devuelva un error.


=LET(xx;B1:F8;a;SI(ESTEXTO(xx);xx;NOD());a)


Obtenemos los pájaros.











Usamos la funcion ENCOL, como argumento matriz es el condicional SI, como argumento ignorar, seleccionamos 3, es decir, ignorar blancos y errores.


=LET(xx;B1:F8;a;ENCOL(SI(ESTEXTO(xx);xx;NOD());3));a)


Usamos UNICOS antes de ENCOL.


=LET(xx;B1:F8;a;UNICOS(ENCOL(SI(ESTEXTO(xx);xx;NOD());3));a)


Ordenamos.


=LET(xx;B1:F8;a;ORDENAR(UNICOS(ENCOL(SI(ESTEXTO(xx);xx;NOD());3)));a)


Tenemos los pájaros únicos ordenados.















Creamos otra variable, y, nos traemos la expresión de la variable “a”, excepto ORDENAR y UNICOS.


=LET(xx;B1:F8;a;ORDENAR(UNICOS(ENCOL(SI(ESTEXTO(xx);xx;NOD());3)));b;ENCOL(SI(ESTEXTO(xx);xx;NOD());3)


Ternemos los pájaros.






















Creamos otra variable, preguntamos si es numero la variable “xx”, ponemos el símbolo de asterisco, entre paréntesis, ponemos de nuevo la variable “xx”, y, comparamos con distinto a cero.


=LET(xx;B1:F8;a;ORDENAR(UNICOS(ENCOL(SI(ESTEXTO(xx);xx;NOD());3)));b;ENCOL(SI(ESTEXTO(xx);xx;NOD());3);c;ESNUMERO(xx)*(xx<>0);c)


Obtenemos una matriz desbordada con 1 donde es número, y, 0 donde no lo es.











Preguntamos que si es numero es igual a VERDADERO, que nos devuelva el rango B1:F8, en caso contrario, que devuelva un error.


=LET(xx;B1:F8;a;ORDENAR(UNICOS(ENCOL(SI(ESTEXTO(xx);xx;NOD());3)));b;ENCOL(SI(ESTEXTO(xx);xx;NOD());3);c;SI(ESNUMERO(xx)*(xx<>0);xx;NOD());c)


Usamos ENCOL e ignoramos blancos y errores.


=LET(xx;B1:F8;a;ORDENAR(UNICOS(ENCOL(SI(ESTEXTO(xx);xx;NOD());3)));b;ENCOL(SI(ESTEXTO(xx);xx;NOD());3);c;ENCOL(SI(ESNUMERO(xx)*(xx<>0);xx;NOD());3);c)


Tenemos las cantidades.






















Tenemos una variable con los pájaros en vertical, y, otra variable con las cantidades en vertical.


Creamos otra variable, usamos MAP, como argumento matriz ponemos la variable “a”, como argumento funcion, ponemos LAMBDA, declaramos una variable.


=LET(xx;B1:F8;a;ORDENAR(UNICOS(ENCOL(SI(ESTEXTO(xx);xx;NOD());3)));b;ENCOL(SI(ESTEXTO(xx);xx;NOD());3);c;ENCOL(SI(ESNUMERO(xx)*(xx<>0);xx;NOD());3);d;MAP(a;LAMBDA(x


Como argumento calculo de LAMBDA, ponemos la funcion SUMA, como argumento usamos el condicional SI, como argumento prueba lógica, preguntamos si la variable “x” es igual a la variable “b”, como argumento valor si verdadero, ponemos la variable “c”, como argumento valor si falso, ponemos blanco.


=LET(xx;B1:F8;a;ORDENAR(UNICOS(ENCOL(SI(ESTEXTO(xx);xx;NOD());3)));b;ENCOL(SI(ESTEXTO(xx);xx;NOD());3);c;ENCOL(SI(ESNUMERO(xx)*(xx<>0);xx;NOD());3);d;MAP(a;LAMBDA(x;SUMA(SI(x=b;c;""))));d)


Ya tenemos las cantidades que corresponden con cada pájaro.
















Como argumento calculo de LET, usamos APILARH, como argumento matriz1, ponemos la variable “a”, como argumento matriz2, ponemos la variable “d”.


=LET(xx;B1:F8;a;ORDENAR(UNICOS(ENCOL(SI(ESTEXTO(xx);xx;NOD());3)));b;ENCOL(SI(ESTEXTO(xx);xx;NOD());3);c;ENCOL(SI(ESNUMERO(xx)*(xx<>0);xx;NOD());3);d;MAP(a;LAMBDA(x;SUMA(SI(x=b;c;""))));APILARH(a;d))


Aceptamos, y, ya lo tenemos.


















Las siguientes expresiones, podíamos sustituirla y crear una única funcion.


=LET(xx;B1:F8;a;ORDENAR(UNICOS(ENCOL(SI(ESTEXTO(xx);xx;NOD());3)));b;ENCOL(SI(ESTEXTO(xx);xx;NOD());3);c;ENCOL(SI(ESNUMERO(xx)*(xx<>0);xx;NOD());3);d;MAP(a;LAMBDA(x;SUMA(SI(x=b;c;""))));APILARH(a;d))


En la celda K2, usamos LET, creamos una variable, usamos ENCOL, como argumento matriz, seleccionamos el rango B1:F8, como argumento ignorar, seleccionamos 3, como argumento scan by colum, seleccionamos VERDADERO, es decir, analizar por columnas.


=LET(a;ENCOL(B1:F8;3;VERDADERO);a)


Tenemos una matriz desbordada de una columna, donde tenemos el pájaro y la cantidad correspondiente.




















Usamos la funcion AJUSTARFILAS, que nos devuelve una matriz que tengamos en filas en una matriz 2D, es decir, de dos dimensiones.


Antes de ENCOL ponemos AJUSTARFILAS, como argumento vector es la funcion ENCOL, como argumento wrap count, ponemos 2.


=LET(a;AJUSTARFILAS(ENCOL(B1:F8;3;VERDADERO);2);a)


Tenemos una matriz desbordada de dos columnas, en la primera columna, tenemos los pájaros, y, en la segunda columna, las cantidades por pájaros.



















Es decir, estas funciones:


=LET(xx;B1:F8;a;ORDENAR(UNICOS(ENCOL(SI(ESTEXTO(xx);xx;NOD());3)));b;ENCOL(SI(ESTEXTO(xx);xx;NOD());3);c;ENCOL(SI(ESNUMERO(xx)*(xx<>0);xx;NOD());3);d;MAP(a;LAMBDA(x;SUMA(SI(x=b;c;""))));APILARH(a;d))


Ha quedado en una sola funcion.


=LET(a;AJUSTARFILAS(ENCOL(B1:F8;3;VERDADERO);2);a)


Las dos funciones son iguales de validas.


Creamos otra variable, ponemos la funcion ORDENAR, como argumento usamos la funcion UNICOS, como argumento matriz usamos la funcion TOMAR, como argumento matriz, ponemos la variable “a, omitimos el argumento filas, como argumento columnas, ponemos 1.


=LET(a;AJUSTARFILAS(ENCOL(B1:F8;3;VERDADERO);2);b;ORDENAR(UNICOS(TOMAR(a;;1)));b)


Tenemos los pájaros únicos.



















Creamos otra variable, usamos MAP, como argumento array, ponemos la variable “b”, como argumento funcion ponemos LAMBDA, creamos una variable, como argumento cálculo de LAMBDA, ponemos la funcion SUMA, como argumento numero1, usamos el condicional SI, como argumento prueba lógica, ponemos la variable “x” e igualamos a la funcion TOMAR, como argumento matriz, ponemos la variable “a”, omitimos el argumento filas, como argumento columnas, ponemos 1.


=LET(a;AJUSTARFILAS(ENCOL(B1:F8;3;VERDADERO);2);b;ORDENAR(UNICOS(TOMAR(a;;1)));c;MAP(b;LAMBDA(x;SUMA(SI(x=TOMAR(a;;1)


Como argumento valor si verdadero, volvemos a usar la funcion TOMAR, como argumento matriz, ponemos la variable “a”, omitimos el argumento filas, como argumento columnas, ponemos -1, como argumento valor si falso, ponemos blanco.


=LET(a;AJUSTARFILAS(ENCOL(B1:F8;3;VERDADERO);2);b;ORDENAR(UNICOS(TOMAR(a;;1)));c;MAP(b;LAMBDA(x;SUMA(SI(x=TOMAR(a;;1);TOMAR(a;;-1);""))));c)


Aceptamos, y, ya tenemos las cantidades por pájaro.

















Usamos el argumento cálculo de LET, ponemos APILARH, como argumento matriz1, ponemos la variable “b”, como argumento matriz2, ponemos la variable “c”.


=LET(a;AJUSTARFILAS(ENCOL(B1:F8;3;VERDADERO);2);b;ORDENAR(UNICOS(TOMAR(a;;1)));c;MAP(b;LAMBDA(x;SUMA(SI(x=TOMAR(a;;1);TOMAR(a;;-1);""))));APILARH(b;c))


Aceptamos, y, ya lo tenemos.














Como he dicho anteriormente, las dos funciones son iguales de validas.




Miguel Angel Franco

 
 
 

Comentarios


© 2019 Miguel Ángel Franco García

bottom of page