SUMIF Formula

craigg3

Board Regular
Joined
Dec 23, 2002
Messages
161
Office Version
  1. 2013
Platform
  1. Windows
Trying to find out how to get a SUMIF to work on the following information.

I have the following columns of data:
Col A Col B
Apr-19 $25
Apr-19 $50
Apr-19 $75
Apr-19 $25
Apr-19 $50
May-19 $100

I only want to SUMIF Anything that is Apr-19, so for the example above the answer would be $225. If May-19 was the first one is Col A, then I would only want to SUMIF May-19.
The problem I have is Apr-19 may really be 4/12/2019 for the first one, and then 4/15/19 for the second one. I need a way to SUMIF everything that is in the Month of April and Year 2019 (disregard day of month) and if May-19 was at the Top of the list then I would want to use SUMIF on everything for the Month of May and Year 2019.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
what version of excel are you using

=SUMIFS(B2:B7,A2:A7,"> ="&DATE(YEAR(A2),MONTH(A2),DAY(1)),A2:A7,"< ="&EOMONTH(A2,0))
 
Upvote 0
Hey there,

Col ACol B Sum where A2 month matches others
4/1/1925
4/5/1950=SUMPRODUCT(--(MONTH(A2:A7)=MONTH(A2))*B2:B7)
4/7/1975225
4/17/1925
4/29/1950
5/19/19100

<tbody>
</tbody>

You can use
=SUMPRODUCT(--(MONTH(A2:A7)=MONTH(A2))*B2:B7)

<tbody>
</tbody>

This will take the month from first data cell in column A, and than sum all range where month is same.

Have a good day.
 
Upvote 0
You coild use this array formula:
ABCDEF
401-04-1925
502-04-1950
603-04-1976226Array formula
704-04-1925
805-04-1950
915-05-19100

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet7

Array Formulas
CellFormula
D6{=SUM((B4:B9)*(MONTH(A4:A9)=MONTH($A$4)))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Upvote 0
If you must use SUMIF create a helper column...

ABCDEFGH
101-04-19425226SUMIF using helper column
202-04-19450
303-04-19476226Array formula
404-04-19425
505-04-19450
615-05-195100

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet7

Worksheet Formulas
CellFormula
E1=SUMIF(B1:B6,MONTH(A1),C1:C6)
B1=MONTH(A1)
B2=MONTH(A2)
B3=MONTH(A3)
B4=MONTH(A4)
B5=MONTH(A5)
B6=MONTH(A6)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
E3{=SUM((C1:C6)*(MONTH(A1:A6)=MONTH($A$1)))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,216,089
Messages
6,128,750
Members
449,466
Latest member
Peter Juhnke

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