I´m using SumIf function for one of my calculations in a spreadsheet, but not getting the expected result. The formula returns zero & spills over. I´m sure I´m making some silly mistake but couldn´t figure out. Can the experts in this forum help please?
I have to fix the following problems -
1. Formula returns zero. It should return the correct value.
2. Formula returns an array & spills over. I need a single value returned. NOT an array.
Due to other complexities I can´t use pivot to get the yearly total & have to use formula only. How can this issue with sumif be resolved? Or do you suggest any better method to get the expected result thru formula?
Consider the simplified tables below for illustration only. Actual table is much more complicated with data running into thousands of rows & large number of columns.
Table-1 has the base data showing the amount at various dates. I would like to sum up the amount for each year in Table-2. Values in column J in table-2 is what I expect. When I try to get the same result using sumif, it is returning zero (column K).
Table-1
Table-2
I have to fix the following problems -
1. Formula returns zero. It should return the correct value.
2. Formula returns an array & spills over. I need a single value returned. NOT an array.
Due to other complexities I can´t use pivot to get the yearly total & have to use formula only. How can this issue with sumif be resolved? Or do you suggest any better method to get the expected result thru formula?
Consider the simplified tables below for illustration only. Actual table is much more complicated with data running into thousands of rows & large number of columns.
Table-1 has the base data showing the amount at various dates. I would like to sum up the amount for each year in Table-2. Values in column J in table-2 is what I expect. When I try to get the same result using sumif, it is returning zero (column K).
Table-1
Book2 | |||||
---|---|---|---|---|---|
C | D | E | |||
3 | # | Date | Amount | ||
4 | 1 | 02-mar-23 | 1000 | ||
5 | 2 | 10-jul-23 | 100 | ||
6 | 3 | 08-feb-24 | 1100 | ||
7 | 4 | 12-may-24 | 200 | ||
8 | 5 | 28-ago-24 | 250 | ||
9 | 6 | 30-ene-25 | 300 | ||
10 | 7 | 02-oct-25 | 400 | ||
Sheet1 |
Table-2
Book2 | |||||
---|---|---|---|---|---|
I | J | K | |||
3 | Year | Amount | Amount (sumif) | ||
4 | 2023 | 1100 | 0 | ||
5 | 2024 | 1550 | 0 | ||
6 | 2025 | 700 | 0 | ||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
K4:K10 | K4 | =SUMIF(D4:D10,VALUE(I4)=VALUE(TEXT(D4:D10,"aaaa")),E4:E10) |
Dynamic array formulas. |