Excel: Sumifs multiple date criteria - excel

I'm trying to sum payments, paid within a year of the start date but my sumifs functions doesn't seem to work as desired. Any idea what needs to be tweaked?
=SUMIFS(C2:C11,B2:B11,">="&I3,B2:B11,"<="&K3,D2:D11,">="&B2:B11,D2:D11,"<="&E2:E11)
Excel Data:

Here is a SUMPRODUCT():
=SUMPRODUCT($C$2:$C$11*($B$2:$B$11>=I3)*($B$2:$B$11<=K3)*($D$2:$D$11>=$B$2:$B$11)*($D$2:$D$11<=$E$2:$E$11))
The SUMPRODUCT, will iterate through the range and do the comparisons. If all the Boolean arguments resolve to true then the value of C at that row will be added.

Related

How to simplify adding multiple countifs formula in excel

I want to count the number of cells that meet two conditions:
sheet ABC's A2:A100 should be equal to the value of sheet XYC cell A8
the cell value in range D2:M100 = 1
Originally, I tried to use this formula:
=COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$D$2:$M$100,1)
But this gave me error #VALUE
I then decided to use the following formula to count each column separately and add them together.
=COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$D$2:$D$100,1)+
COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$E$2:$E$100,1)+
COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$F$2:$F$100,1)+
COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$G$2:$G$100,1)+
COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$H$2:$H$100,1)+
COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$I$2:$I$100,1)+
COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$J$2:$J$100,1)+
COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$K$2:$K$100,1)+
COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$L$2:$L$100,1)+
COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$M$2:$M$100,1)
I am wondering if there are any other ways that allows me to shorten my formula?
Thank you.
You can use a boolean structure inside SUMPRODUCT() or just SUM() if your version of Excel supports dynamic arrays (ms365):
=SUMPRODUCT((ABC!A2:A100=XYC!A8)*(ABC!D2:M100=1))

Excel COUNTIFS between date range

How do I count between a date range using COUNIFS? The dates are set as columns The_Date_Start and The_Date_End.
My formula is
=COUNTIFS(Sheet2!C:C,[#Tel],Sheet2!A:A,"<="&[#[The_Date]])
I have tried something like the below but doesn't work
=COUNTIFS(Sheet2!C:C,[#Tel],Sheet2!A:A,"=>"&[#[The_Date_Start]],"<="&[#[The_Date_End]])
You can use this formula:
=COUNTIFS([ColToCount], ">="&[#End], [ColToCount], "<="&[#Start])
Note that all the ranges should be of same length. In your formula, they are of different lengths

SUMIFS Is Blank OR Other Condition

I am trying to sum the values in the B2:B4 range using the SUMIFS function if the dates in the C2:C4 range are either blank or after the date in cell C1.
I can add the values in B if cells in C2:C4 are either blank or if the dates are after C1, in separate formulae, but I cannot seem to combine those conditions into one formula with an OR condition.
=SUMIFS(B2:B4,C2:C4,"") + SUMIFS(B2:B4,C2:C4,">"&C1)
The formula that I am working on is actually much longer and complicated so I want to combine these conditions into one formula or condition inside a SUMIFS if possible.
I have looked for hours but cannot seem to find what I am looking for. Solutions I have found thus far test for blank and a text value or if greater than 0, but not a comparison of non-text non-zero values such as dates. Does anyone know of the solution?
I think we can not put the "or" condition in one criteria range with cell reference.
You can use the SUMIFS formula but you have to hard code the criteria value of date.
Pass the "or" conditions in { },this will return the value for both "or" conditions than use SUM function to get the total value.
SUM(SUMIFS(B2:B4,C2:C4,{">15-05-2021",""}))
Use of SUMPRODUCT function will be a better option in given condition
SUMPRODUCT(--(C2:C4>C1)+(C2:C4=""),B2:B4)

Using month qualification in SUMIFS statment

Here's what I'm looking for....
Trying to Sum the count of worksheet 'Results 2013' column G items
IF Cell A matches "Canada"
IF Cell E (date) is July
Having trouble with the date portion of the SUMIFS statement below.
SUMIFS('Results 2013'!$G$2:$G$510,'Results 2013'!$A2:$A$510
,"=Canada",'Results 2013'!$E2:$E510,MONTH('Results 2013'!$E2:$E510)=7)
Example value of "Results 2013"$E$480 is
I try this formula, and it provides back "January" which is obviously incorrect.
=TEXT(MONTH('Results 2013'!$E$480),"mmmm")
However, this formula, results in TRUE or 1
=IF(MONTH('Results 2013'!$E$480)=7,1,0)
The simplest solution is to add a column Month using the MONTH function to compute values, and then refer to this new column in SUMIFS.
This tests whether the date values in column E fall within the range 7/1/2013 and 7/31/2013. If your dates all fall within 2013, it will work.
SUMIFS('Results 2013'!$G$2:$G$510,'Results 2013'!$A2:$A$510,"=Canada",
'Results 2013'!$E2:$E510,">="&DATE(2013,7,1),
'Results 2013'!$E2:$E510,"<="&DATE(2013,7,31))
This array formula will work with the more general case of dates falling within any year:
=SUM(G2:G510*(A2:A510="Canada")*(MONTH(E2:E510)=7))
You could use an array formula , then you can use month on the entire column:
{SUM(if('Results 2013'!$A2:$A$510="Canada",1,0)*if(MONTH('Results 2013'!$E2:$E510)=7,'Results 2013'!$G$2:$G$510,0))}
just remember to use ctrl+shift+enter rather than the usual enter to finish the formula

Add total SUM from VLOOKUP?

I've got 3 columns as follows:
Boolean Value Date
Yes £3000 01-Jan-2012
No £3000 01-Jan-2012
No £3000 01-Nov-2012
Basically I just need to look at that table and come up with the total value for where Boolean is set to No, however only take those where the month is equal or less than the current month set by the computer time
Which version of Excel? In Excel 2007 and later try SUMIFS which allows you to sum with multiple conditions, i.e.
=SUMIFS(B2:B10,A2:A10,"No",C2:C10,"<="&TODAY())
I used cell references but you can used named ranges in their place like this:
=SUMIFS(Value,Boolean,"No",Date,"<="&TODAY())
or in earlier versions of Excel you can use SUMPRODUCT like this:
=SUMPRODUCT(B2:B10,(A2:A10="No")*(C2:C10<=TODAY()))
Use the DSUM function.
Criteria range would be
Boolean Month Check
No =MONTH(C2) < X
where C2 is the first data cell in column Date.

Resources