# SUMIF - two criteria wont sum between two date ranges

#### twilliamsli

##### New Member
I am attempting to sum payments on one tab and return the sum to another tab. The payments are identified by a unique identifier - a loan number. The are multiple payments per loan, and hundreds of loans.

My original formula works - that is to sum all payments from (after) one date: =SUMIFS(Payments!Q:Q,Payments!A:A,@'Legal vs Payments'!A:A,Payments!G:G,">"&J4).
(in summary, sum all the payments found in Column Q on the "payments tab" if all the loan numbers in Columns A, on the Payments and Legal Payments tab match, sum all after date found in Column J)
The problem is when I add an end date to the formula - it returns a \$0.00 or #name? error. I have tried two ways:
first method =SUMIFS(Payments!Q:Q,Payments!A:A,@'Legal vs Payments'!A:A,Payments!A:A,">="&E4, dates, "<="&F4) - this returns a #name? error
the second method - =SUMIFS(Payments!Q:Q,Payments!A:A,@'Legal vs Payments'!A:A,Payments!A:A,">="&E5,Payments!Q:Q,"<="&F5) - this returns a \$0.00 return.

I thought it might be a simple typo - I think it is more of a formula layout, that I am not seeing.

any assistance you can offer would be greatly appreciated........

### Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

#### Fluff

##### MrExcel MVP, Moderator
Bit confusing as your cells seem to change, but maybe
Excel Formula:
``=SUMIFS(Payments!Q:Q,Payments!A:A,@'Legal vs Payments'!A:A,Payments!G:G,">="&E5,Payments!G:G,"<="&F5)``

#### jasonb75

##### Well-known Member
Highlighting your errors so you can see where you went wrong.

In the first formula, the #NAME? error tells us that a name used in the formula doesn't exist, comparing it to your working formula, it can only be dates which implies a non existent named range.

=SUMIFS(Payments!Q:Q,Payments!A:A,@'Legal vs Payments'!A:A,Payments!A:A,">="&E4, dates, "<="&F4)

In the second formula, you have applied the new date criteria to the sum column instead of the criteria column.

=SUMIFS(Payments!Q:Q,Payments!A:A,@'Legal vs Payments'!A:A,Payments!A:A,">="&E5,Payments!Q:Q,"<="&F5)

Changing that to the correct column for the dates should work.

=SUMIFS(Payments!Q:Q,Payments!A:A,@'Legal vs Payments'!A:A,Payments!A:A,">="&E4,Payments!A:A, "<="&F4)

Although, I think that @Fluff's suggestion above might be more accurate, there appear to be too many criteria pointing to the same column in your formula but the reference to column G in the first was something that I missed.

#### twilliamsli

##### New Member
Bit confusing as your cells seem to change, but maybe
Excel Formula:
``=SUMIFS(Payments!Q:Q,Payments!A:A,@'Legal vs Payments'!A:A,Payments!G:G,">="&E5,Payments!G:G,"<="&F5)``
Thank you, this worked perfectly. I did not realize the payments were in multiple places in the data. Thank you

#### Fluff

##### MrExcel MVP, Moderator
Glad we could help & thanks for the feedback.

Replies
4
Views
112
Replies
1
Views
116
Replies
0
Views
57
Replies
3
Views
340
Replies
3
Views
124

1,127,098
Messages
5,622,682
Members
415,920
Latest member
ExcelNoob28

### 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.

### Which adblocker are you using?

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

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