Sumif is January also counting blank date cells

dsrt16

Board Regular
Joined
Jun 18, 2005
Messages
208
I have sumif formulas calculating the net for the month; all of them work except January. January also counts cells that don't have a date at all. The users want to calculate their net before taxes, so the taxes date is left blank so they don't factor into any month.

However, January then returns a net applying all taxes in Quarter 1 (January, February, and March) because it is counting any cells without a date as January.

Here is the formula:
{=SUM(IF(MONTH(A10:A85)=1, E10:E85,0))}

I need it to only sum the amount if there is a January date in A10:A85, but as mentioned it is also calculating in amounts that are not given a date.

I tried

{=SUM(IF(AND(MONTH(A10:A85)=1, A10:A85<>""),E10:E85,0))}

But that just returned $0.00
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
=sumproduct(--(month(a10:a85)=1),--(a10:a85<>0),(e10:e85))

Array enter
=SUM(IF(MONTH(A10:A85)=1,IF(A10:A85<>"",E10:E85)))
 
Last edited:
Upvote 0
I solved it. I forgot I couldn't use AND in that situation.

This formula worked:

{=SUM(IF((MONTH(A11:A86)=1)*(A11:A86<>""), E11:E86,0))}
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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