sumif and date range

%3CLINGO-SUB%20id%3D%22lingo-sub-2787951%22%20slang%3D%22en-US%22%3Esumif%20and%20date%20range%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2787951%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20was%20wondering%20if%20someone%20can%20help%20me%20with%20a%20Sumif%20and%20date%20range%20formula%3F%3C%2FP%3E%3CP%3EI%20wanted%20to%20add%20invoices%20for%20two%20date%20ranges%20for%20one%20client.%3C%2FP%3E%3CP%3EI've%20attached%20a%20file%20with%20some%20data%20in%20it%20that%20explains%20what%20I%20want%20to%20do.%3C%2FP%3E%3CP%3EThanks%20in%20advance%20for%20your%20help!%3C%2FP%3E%3CP%3EGina%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2787951%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2788002%22%20slang%3D%22en-US%22%3ERe%3A%20sumif%20and%20date%20range%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2788002%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1167570%22%20target%3D%22_blank%22%3E%40GT1704%3C%2FA%3E%26nbsp%3BPerhaps%20the%20attached%20file%20will%20work%20for%20you.%20I've%20used%20SUMPRODUCT%20in%20stead%20of%20SUMIF.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2788055%22%20slang%3D%22en-US%22%3ERe%3A%20sumif%20and%20date%20range%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2788055%22%20slang%3D%22en-US%22%3EThank%20you%20Riny_van_Eekelen!%3CBR%20%2F%3EThis%20works%20very%20well.%20I%20have%20not%20used%20SUMPRODUCT%20before%20and%20this%20is%20an%20excellent%20alternative.%3CBR%20%2F%3ECheers%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2788084%22%20slang%3D%22en-US%22%3ERe%3A%20sumif%20and%20date%20range%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2788084%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1167570%22%20target%3D%22_blank%22%3E%40GT1704%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EC12%3A%20%3DSUMIF(D2%3AD4%2C%22%26lt%3B%3D%22%26amp%3B%2215.09.2021%22%2CH2%3AH4)%3C%2FP%3E%3CP%3EC13%3A%26nbsp%3B%3DSUMIF(D2%3AD4%2C%22%26gt%3B%3D%22%26amp%3B%2216.09.2021%22%2CH2%3AH4)%3C%2FP%3E%3CP%3E%3CSPAN%3Eyou%20need%20to%20press%20Ctrl%2BShift%2BEnter%20to%20enter%20them%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Foffice%2Fcreate-an-array-formula-e43e12e0-afc6-4a12-bc7f-48361075954d%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3ECreate%20an%20array%20formula%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EArray%20formulas%20are%20powerful%20formulas%20that%20enable%20you%20to%20perform%20complex%20calculations%20that%20often%20can%E2%80%99t%20be%20done%20with%20standard%20worksheet%20functions.%20They%20are%20also%20referred%20to%20as%20%22Ctrl-Shift-Enter%22%20or%20%22CSE%22%20formulas%2C%20because%20you%20need%20to%20press%20Ctrl%2BShift%2BEnter%20to%20enter%20them.%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20be%20happy%20to%20know%20if%20I%20could%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENikolino%3C%2FP%3E%3CP%3EI%20know%20I%20don't%20know%20anything%20(Socrates)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E*%20Kindly%20Mark%20and%20Vote%20any%20reply%20if%20it%20helps%20please%2C%20as%20it%20will%20be%20beneficial%20to%20more%20Community%20members%20reading%20here.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi,

I was wondering if someone can help me with a Sumif and date range formula?

I wanted to add invoices for two date ranges for one client.

I've attached a file with some data in it that explains what I want to do.

Thanks in advance for your help!

Gina

7 Replies

@GT1704 Perhaps the attached file will work for you. I've used SUMPRODUCT in stead of SUMIF.

 

Thank you Riny_van_Eekelen!
This works very well. I have not used SUMPRODUCT before and this is an excellent alternative.
Cheers

@GT1704 

 

C12: =SUMIF(D2:D4,"<="&"15.09.2021",H2:H4)

C13: =SUMIF(D2:D4,">="&"16.09.2021",H2:H4)

you need to press Ctrl+Shift+Enter to enter them

Create an array formula

Array formulas are powerful formulas that enable you to perform complex calculations that often can’t be done with standard worksheet functions. They are also referred to as "Ctrl-Shift-Enter" or "CSE" formulas, because you need to press Ctrl+Shift+Enter to enter them.  

 

I would be happy to know if I could help.

 

Nikolino

I know I don't know anything (Socrates)

 

* Kindly Mark and Vote any reply if it helps please, as it will be beneficial to more Community members reading here.

Thank you NikolinoDE for taking the time to answer my question.
This works very well.

@GT1704 

Others have already answered but since I laid out the sheet before going to lunch ...

I would most likely go with SUMIFS, but there are alternatives

= SUMPRODUCT(
    IF(
      (Description=ClientName)*
        (MONTH(Date)=9)*
        (DAY(Date)<=15),
      Amount))

The SUMPRODUCT is simply a wrapper that makes legacy Excel process arrays correctly; I reality, I use SUM.  By the way, I needed to re-commit your dates because they came over as text.

 

@Peter Bartholomew 

As cosmetic

MONTH(Date)=9

=>

MONTH(Date)= MONTH(startMonth)
Agreed. I guess I was mesmerised as to how the OP got March figures out of September dates (text at that). For me semantics and legibility are a critical element of code development but I have to recognise that others prioritise brevity or the speed of code creation.