#### Dark0Prince

##### Active Member
=SUMIFS(JOET2!D:D,JOET2!A:A,8568,JOET2!B:B,2016,JOET2!E:E,12)

So what I want it to do is count the cells in D column, when a column has 8568 &b column has a date with 2016 in it like 12/01/2016 and when E column has the correct month in it so i just did =B and formatted it to show me MM. but nothing adds up.

### Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},\$Z\$1:\$Z\$99,\$Y\$1:\$Y\$99),2,False) to lookup Y values to left of Z values.

#### Scott Huish

##### MrExcel MVP
If Columns B and E contain actual dates that won't work because it's looking for a literal match to 2016 and 12

Try something like this:

=SUMPRODUCT(--(YEAR(JOET2!B1:B1000)=2016),--(MONTH(JOET2!E1:E1000)=12),JOET2!D1:D1000)

#### Dark0Prince

##### Active Member
If Columns B and E contain actual dates that won't work because it's looking for a literal match to 2016 and 12

Try something like this:

=SUMPRODUCT(--(YEAR(JOET2!B1:B1000)=2016),--(MONTH(JOET2!E1:E1000)=12),JOET2!D1:D1000)

I'm getting a value error on that formula and i'm doing ctrl shift enter as well. What is the last part of this forumuladoing ? counting the cells in D column?

#### Dark0Prince

##### Active Member
I'm getting a value error on that formula and i'm doing ctrl shift enter as well. What is the last part of this forumuladoing ? counting the cells in D column?

I reread the formula and it looks like line one was counted and that was just headers so I changed that and it worked to sum numbers but I was trying to count the cells how can I change this?

#### Scott Huish

##### MrExcel MVP

It doesn't need CTRL-SHIFT-ENTER. The last column is returning the values from column D. For every TRUE/FALSE for the first 2 conditions it will return 1 or 0, and it will multiply that by the value in Column D and sum all those values. If either of the 2 values is false it would be something like 1 * 0 * Value in Column D, so both values would have to be true for column D to be included in the sum.

Are the ranges you put in the formula the exact same size? Can you post the formula as you have used it.

To count the rows instead of summing just eliminate the last section of the formula:

=SUMPRODUCT(--(YEAR(JOET2!B2:B1000)=2016),--(MONTH(JOET2!E2:E1000)=12))

Last edited:

#### Dark0Prince

##### Active Member
Thanks works great now! Also i had account numbers in row D so that would have been bad if it was multiplying

#### Scott Huish

##### MrExcel MVP
Glad you got it working. Column D was what you had in your sum range in your original post which is why I included it.

Replies
9
Views
374
Replies
8
Views
199
Replies
2
Views
77
Replies
0
Views
150
Replies
16
Views
307

1,127,009
Messages
5,622,145
Members
415,881
Latest member
tasic89

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