Forum Discussion
SUMIF [sum_range] select different columns
Hi to everyone!
First of all, thank you for your help!
I have been struggling with a SUMIF formula (SUMAR.SI in Spanish)
As you know, the syntax of the formula is SUMIF(range, criteria, [sum_range])
I would like to change the [sum_range] column depending on a formula.
The data I want to obtain the info from is organiced like this (by products):
A | B | C | D | E | F | G |
jul | ago | sep | oct | nov | dic | |
Venta el año pasado | 36.960,00 | 36.000,00 | 31.840,00 | 24.480,00 | 23.360,00 | 24.640,00 |
Presupuesto | 38.000,00 | 39.900,00 | 34.125,00 | 29.400,00 | 26.250,00 | 26.250,00 |
Venta Semana 1 | 9.760,00 | 10.400,00 | 8.480,00 | 7.360,00 | 5.920,00 | 6.400,00 |
Venta Semana 2 | 9.440,00 | 11.360,00 | 8.000,00 | 6.080,00 | 6.240,00 | 5.920,00 |
Venta Semana 3 | 9.280,00 | 7.680,00 | 8.800,00 | 6.880,00 | 6.240,00 | 7.680,00 |
Venta Semana 4-5 | 11.200,00 | 15.200,00 | 10.560,00 | 11.360,00 | 9.280,00 | 6.880,00 |
The columns, as you can see, are the different months.
Depending on which week (semana) of the year I’m preparing the report, I want to SUMIF from that specific month.
Per example,
If I want to SUMIF the budget “Presupuesto” of September “sep” I would write: SUMAR.SI(A:A;”Presupuesto”;D:D)
If I want to SUMIF the budget “Presupuesto” of December “dic” I would write: SUMAR.SI(A:A;”Presupuesto”;G:G)
The problem is that I don’t want to have to write the last argument of the formula, I want it to be given from a cell that contains another formula (that VLOOKS up from a table that contains the different weeks of the year)
SEMANA |
| MES | COLUMNA | SEMANA INFORME | INICIO | FIN |
Semana 26 | 6 | jun | B | Venta Semana 4-5 | 26-jun-17 | 02-jul-17 |
Semana 27 | 7 | jul | B | Venta Semana 1 | 03-jul-17 | 09-jul-17 |
Semana 28 | 7 | jul | B | Venta Semana 2 | 10-jul-17 | 16-jul-17 |
Semana 29 | 7 | jul | B | Venta Semana 3 | 17-jul-17 | 23-jul-17 |
Semana 30 | 7 | jul | B | Venta Semana 4-5 | 24-jul-17 | 30-jul-17 |
Semana 31 | 7 | jul | B | Venta Semana 4-5 | 31-jul-17 | 06-ago-17 |
Semana 32 | 8 | ago | C | Venta Semana 1 | 07-ago-17 | 13-ago-17 |
Semana 33 | 8 | ago | C | Venta Semana 2 | 14-ago-17 | 20-ago-17 |
Semana 34 | 8 | ago | C | Venta Semana 3 | 21-ago-17 | 27-ago-17 |
So, my question is…
Is it possible to write the SUMIF formula obtaining the [sum_range] from another specific cell that contains a formula?
Thanks again,
Angela.
If you do need the Dynamic Range option then I've attached an example file of how you could do it
4 Replies
If you do need the Dynamic Range option then I've attached an example file of how you could do it
- Angela Descalzo JorroCopper Contributor
Thanks!!!
That is a great solution for my problem!
Angela
- You’re welcome
- Hi Angela,
Are you using SUMIF becuase there will be multiple rows with values for items like Presupuesto and Venta Semana? If not then then there may be an alternative way using INDEX MATCH MATCH
If there will be multiple occurrences then another simpler approach would be to use Power Query to "unpivot" the data so the months end up in a single column rather than across the columns. Then a simple SUMIFS formula would work.
Is this an option for you?
Let me know and I can advise further
Wyn