Is there a way to search a date column for a date range and then if the date falls within a certain range, I would like to include any amount ordered within that date range in a sum. If the dates are outside that range, do not include the number ordered

Todd H 0 Reputation points
2024-11-15T22:14:30.8433333+00:00

Column A has different dates upon which product was ordered

Column b has the number of product that were ordered on that date

I want to sum up all the orders from, for example, October only. What is a formula to use to search column A for only dates that fall in October and then include only those orders in the sum?

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,991 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Barry Schwarz 3,071 Reputation points
    2024-11-16T10:01:23.0933333+00:00

    The SUMIFS function will what you want.

    SUMIFS(B1:B10,A1:A10,">="&DATE(2024,10,1),A1:A10,"<="&DATE(2024,10,31))
    

    However, if you plan to change the date range frequently, updating the constants in the formula is cumbersome. I find it easier to put the start and end dates is some otherwise unused cells and reference those cells in the SUMIFS function.

    0 comments No comments

  2. Emi Zhang-MSFT 25,796 Reputation points Microsoft Vendor
    2024-11-18T07:37:19.6133333+00:00

    Hi,

    Try this formula:

    =SUMPRODUCT((MONTH($A$2:$A$17)=E2)*$B$2:$B$17)

    User's image

    Just checking in to see if the information was helpful. Please let us know if you would like further assistance.


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.