Link to home
Start Free TrialLog in
Avatar of Ryan Simmons
Ryan Simmons

asked on

How can I use SUMIF to find the data from previous week?

Example Dataset attached. How can I use SUMIF to find the number from column B from the previous week which is A2-7?
Example.xls
Avatar of NBVC
NBVC
Flag of Canada image

You have a formula there that seems to be the correct one based on your question.

Why do you think it is not working?  Apr 2, 2016 shows up multiple times in column A so you are getting a sum of all those times.
Avatar of Ryan Simmons
Ryan Simmons

ASKER

Ah... you are right. So how can I get the SUMIF to accept a second criteria? Basically there are stores and I only need the demand for one store for previous week. Second example attached.
Example-2.xls
ASKER CERTIFIED SOLUTION
Avatar of NBVC
NBVC
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi, try below array formula, remember to press Ctrl+shift+enter

=SUM(IF(($A$2:$A2>=($A2-6))*($A$2:$A2<=$A2), $B$2:$B2, 0))
Perfect, ty!