Share via

how to use SUMIFS function where criteria is between two dates

Anonymous
2022-10-07T23:16:38+00:00

Here is my equation in cell a406:=SUMIFS(B3:B399,A3:A399,"=>A405",A3:A399,"<B405"). Column B3:b399 contains numbers, column A has dates. A405 represents one date and B405 a second date. Currently they are 9/1/21 and 10/1/21 and I am trying to sum the numbers in column B between those dates. My answer is zero "0". What am I doing wrong?

Thanks!

Microsoft 365 and Office | Excel | For home | MacOS

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

  1. Anonymous
    2022-10-08T00:19:00+00:00

    The only thing I don't completely understand is the use of the "&" key. Is the purpose of the "&" to tell Excell that what follows is a cell reference?

    No. Ampersand ("&") is the concatenation operator. It creates a string.

    Thus, for example, ">=" & A440 forms the string ">= 9/1/2022".

    Actually, it forms the string ">= 44805" because 44805 is how Excel represents the date 9/1/2022 internally on systems that represent "short dates" in the MDY form.

    In both cases, SUMIFS parses the string and understands that to mean "greater than or equal to the value 44805".

    PS.... As long as A440 contains a numeric Excel date, it does not matter how it is formatted. But if we wrote literally ">= 9/1/2022" in the SUMIFS formula, 9/1/2022 might be (mis)interpreted as 9 Jan 2022 on systems that represent "short dates" in the DMY form, even though it might be interpreted as 1 Sep 2022 on your system. That is why it is better to use numeric dates -- for example, ">=" & DATE(2022,9,1) -- instead of date strings.

    7 people found this answer helpful.
    0 comments No comments

Answer accepted by question author

  1. Anonymous
    2022-10-07T23:48:46+00:00

    Found my answer after figuring out how to use the search button at the top of the page (Doh!). The correct formula is =SUMIFS($B$3:$B$399,$A$3:$A$399,">="&A440,$A$3:$A$399,"<"&B440). The only thing I don't completely understand is the use of the "&" key. Is the purpose of the "&" to tell Excell that what follows is a cell reference?

    4 people found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2022-10-08T00:49:23+00:00

    Thanks! That clears up everything.

    0 comments No comments