SumIf problem

sharshra

Active Member
Joined
Mar 20, 2013
Messages
404
Office Version
  1. 365
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
Book2
CDE
3#DateAmount
4102-mar-231000
5210-jul-23100
6308-feb-241100
7412-may-24200
8528-ago-24250
9630-ene-25300
10702-oct-25400
Sheet1


Table-2
Book2
IJK
3YearAmountAmount (sumif)
4202311000
5202415500
620257000
Sheet1
Cell Formulas
RangeFormula
K4:K10K4=SUMIF(D4:D10,VALUE(I4)=VALUE(TEXT(D4:D10,"aaaa")),E4:E10)
Dynamic array formulas.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
How about:

Excel Formula:
=SUM(FILTER($E$4:$E$10,YEAR($D$4:$D$10)=I4))
 
Upvote 0
Solution
Wow!!! That´s super quick, *hagia_sophia!!! It fixed my problem :love: Thanks a ton (y)
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,125
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top