Sumif, where the range is in date format (11/02/2018) etc, and the criteria is "FEB"

RockandGrohl

Well-known Member
Joined
Aug 1, 2018
Messages
810
Office Version
  1. 365
Platform
  1. Windows
Any way to do this without a helper column?

Need to countif and sumif the following across two sheets:


Column C which has dates like "01/02/2019" in sheet "JG"

Against the criteria of C1 which is just "Jan" on sheet "Front"


Also in my criteria I'm trying to find value B4 in "Front" against the range "H:H" in "JG"


Have tried Sumproduct but it didn't work very well, any ideas? Obviously I can't do "month(C:C)" otherwise my woes would be over. Thanks!
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
To count:

<b>Sheet: Front</b>
Excel Workbook
ABC
1jan
2
3
4some4
Sheet
<b>Sheet: JG</b>
Excel Workbook
ABCDEFGH
1
2
301/01/2019some
401/01/2019any
501/01/2019some
601/01/2019any
701/01/2019some
801/01/2019any
901/01/2019some
Sheet
 
Upvote 0
This is working great, is there a way to SUMPRODUCT value? I now have a count of quantity, I need a total of the value according to those same criteria.

But in which column do you have the data to sum?
 
Upvote 0
I wish Sumifs was more verbose, or able to handle date ranges and their variances without throwing a wobbly.

Hi, is the year important or does your data span mulitple years? Here is a SUMIFS() option that will sum the current year only.


Excel 2013/2016
BC
1jan
2
3
4some19
Sheet1
Cell Formulas
RangeFormula
C4=SUMIFS(JG!F:F,JG!C:C,">=1"&C1,JG!C:C,"<"&EOMONTH(1&C1,0)+1,JG!H:H,B4)




Excel 2013/2016
CDEFGH
301/01/20195some
401/01/20195any
501/01/20191some
601/01/20195any
701/01/20194some
801/01/20198any
901/01/20199some
JG
 
Upvote 0
Hi, is the year important or does your data span mulitple years? Here is a SUMIFS() option that will sum the current year only.

Excel 2013/2016
BC
jan
some

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]

[TD="align: center"]2[/TD]

[TD="align: center"]3[/TD]

[TD="align: center"]4[/TD]

[TD="align: right"]19[/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]C4[/TH]
[TD="align: left"]=SUMIFS(JG!F:F,JG!C:C,">=1"&C1,JG!C:C,"<"&EOMONTH(1&C1,0)+1,JG!H:H,B4)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]




Excel 2013/2016
CDEFGH
some
any
some
any
some
any
some

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]3[/TD]
[TD="align: right"]01/01/2019[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5[/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]
[TD="align: right"]01/01/2019[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5[/TD]
[TD="align: right"][/TD]

[TD="align: center"]5[/TD]
[TD="align: right"]01/01/2019[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]1[/TD]
[TD="align: right"][/TD]

[TD="align: center"]6[/TD]
[TD="align: right"]01/01/2019[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]5[/TD]
[TD="align: right"][/TD]

[TD="align: center"]7[/TD]
[TD="align: right"]01/01/2019[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]4[/TD]
[TD="align: right"][/TD]

[TD="align: center"]8[/TD]
[TD="align: right"]01/01/2019[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]8[/TD]
[TD="align: right"][/TD]

[TD="align: center"]9[/TD]
[TD="align: right"]01/01/2019[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"]9[/TD]
[TD="align: right"][/TD]

</tbody>
JG

Hi,

Thank you very much for this.

For the time being, it's 2019, but eventually we will start taking bookings for 2020 and these figures will need to be reported on. Does the End Of Month formula only count the current year then?
 
Upvote 0
When you have data for Jan 2019 and Jan 2020 do you want a single formula that sums the January totals for both years?

If you do then SUMPRODUCT() is probably the way to go. If you want separate formulas to sum each specific year then that could be done with SUMIFS() but you would need to specify the year you want to sum.
 
Upvote 0
When you have data for Jan 2019 and Jan 2020 do you want a single formula that sums the January totals for both years?

If you do then SUMPRODUCT() is probably the way to go. If you want separate formulas to sum each specific year then that could be done with SUMIFS() but you would need to specify the year you want to sum.



Guys, I appreciate all the help, but I'm scrapping this. The easiest solution is often the best, I've input the dates at the top of the columns as 01/01/2019 and onwards, then formatted them as "mmm" to show "Jan", "Feb", etc. Then just done a countif and sumif to say where the value is greater than or equal to Jan but less than Feb, show me the results.

The trouble with Sumproduct looking across two sheets is the crazy calculation time. I wrote a macro to enter it on a cell-by-cell basis then paste over with values but this still took an age.

So I've gone with the KISS method.

Thanks again for trying to make my dumb method work!
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

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