Search code examples
google-sheetssum

How to sum a column that meets multiple criteria in different rows and columns in Google Sheets


I have a table that has sales data per store. The top row has the store number and under that store number is the sales date per day. What I am trying to do is to create a formula that looks up the store name/number in the top row and then calculates the sales in that column if the date in column D is between 2 values (eg. bigger than 2021-11-01 and smaller than 2021-11-15)

Here is a link to the sample data

https://docs.google.com/spreadsheets/d/1buOZ1lULwhyX8xABR1pKLU0OecZ0g7BCKoz5Rf25Bb8/edit?usp=sharing

I would appreciate any help.

Thanks


Solution

  • You can use:

    =SUM(INDEX(FILTER(D3:K33,D3:D33>N6,D3:D33<N7),,MATCH(N5,D3:K3,0)))
    

    enter image description here