Reputation: 18485
Could you help me to fix this excel error?
I'm trying to write a SUMIFS function. On my first page I have all my banking transaction sorted by date from 2011 to 2014. All transactions belong to one and only one category.
I need to sum my value in Sum_range only if my two criteria are true.
I know the problem is about the year or the date because I can sum with my second condition only.
Upvotes: 1
Views: 4563
Reputation:
While SUMPRODUCT
can use YEAR
like this,
=SUMPRODUCT((YEAR('Transactions LU'!A:A)=A12)*('Transactions LU'!J:J=C11), 'Transactions LU'!H:H)
... you won't want to use full column references (slower) and SUMPRODUCT
can easily break trying to perform math on an extra text value. SUMIFS
is vastly more efficient and in the area of 30% of the calculation load.
=SUMIFS('Transactions LU'!H:H, 'Transactions LU'!A:A, ">="&DATE(A12, 1, 1), 'Transactions LU'!A:A, "<"&DATE(A12 +1, 1, 1), 'Transactions LU'!J:J, C11)
The second SUMIFS
formula is much preferred.
Upvotes: 2
Reputation: 55
Don't 100% understand the issue - but if it is really only the Year column that is making trouble try using Value(A12)
or if that doesn't work TEXT(A12;0)
this either converts the value to text or into number format. It depends whether your data column is in number or text format. (probably try TEXT first).
Upvotes: 0