SOLVED

Filtrar con Sumaproducto

Brass Contributor

Saludos a todos. Tengo Excel 2016 y tengo esta formula: =SUMAPRODUCTO((Gastos!$G$3:$G$1000="impuesto")-(Gastos!$F$3:$F$1000="impuesto al valor agregado");Gastos!$L$3:$L$1000). Su propósito es buscar en la hoja Gastos en el rango G3:G100 el concepto "impuestos" y restar el concepto "impuesto al valor agregado" que se encuentra en la misma hoja, pero en el rango F3:F100. Funciona bien pero me gustaría agregar un nuevo elemento de filtro, en este caso el concepto "factura" que esta en la hoja Gastos en el rango B3:B100, no se como hacerlo. Gracias de antemano por la ayuda.

5 Replies

I don't think that formula does what you think it does. It is very odd. (Gastos!$G$3:$G$1000="impuesto") is either TRUE or FALSE. Ditto (Gastos!$F$3:$F$1000="impuesto al valor agregado"). Subtracting one from the other results in -1, 0 or 1. -1 and 1 are treated by Excel as TRUE. That is, this boolean functions like an XOR (one or the other, but never the two). But it also flips the sign around of the IVA expenses.  I am guessing that IS and IVA never appear on the same expense line. However, if that were so, I would feel more comfortable programming
=SUMAPRODUCTO(((Gastos!$G$3:$G$1000="impuesto") + (Gastos!$F$3:$F$1000="impuesto al valor agregado")) > 0;Gastos!$L$3:$L$1000).
The "+" gives you straight OR. It may also address your question (which is hard to understand). Perhaps this works for you:
=SUMAPRODUCTO((Gastos!$G$3:$G$1000="impuesto") + (Gastos!$F$3:$F$1000="impuesto al valor agregado") + (Gastos!$B$3:$B$1000="factura");Gastos!$L$3:$L$1000).

@a7024782 

Tal vez

 

=SUMAPRODUCTO(((Gastos!$G$3:$G$1000="impuesto")-(Gastos!$F$3:$F$1000="impuesto al valor agregado")*(Gastos!$B$3:$B$1000="factura");Gastos!$L$3:$L$1000)

Gracias por la respuesta. Esa opción ya la había probado, en todo caso, copie y pegue su formula e igualmente me indica que tiene un error
best response confirmed by a7024782 (Brass Contributor)
Solution

@a7024782 

Disculpame, por favor.

 

=SUMAPRODUCTO(((Gastos!$G$3:$G$1000="impuesto")-(Gastos!$F$3:$F$1000="impuesto al valor agregado"))*(Gastos!$B$3:$B$1000="factura");Gastos!$L$3:$L$1000)

Ha funcionado muy bien. Muy agradecido con Ud, de nuevo
1 best response

Accepted Solutions
best response confirmed by a7024782 (Brass Contributor)
Solution

@a7024782 

Disculpame, por favor.

 

=SUMAPRODUCTO(((Gastos!$G$3:$G$1000="impuesto")-(Gastos!$F$3:$F$1000="impuesto al valor agregado"))*(Gastos!$B$3:$B$1000="factura");Gastos!$L$3:$L$1000)

View solution in original post