• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 63
  • Last Modified:

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
0
Ryan Simmons
Asked:
Ryan Simmons
  • 2
  • 2
1 Solution
 
NBVCCommented:
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.
0
 
Ryan SimmonsWorkforce Management Analyst, Murphy USAAuthor Commented:
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
0
 
NBVCCommented:
You can use SUMIFS

e.g.

=SUMIFS(C:C,A:A,A2,B:B,B2-7)

notice the range to sum is at the front now...followed by the criteria ranges and criterias
0
 
YamaafgCommented:
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))
0
 
Ryan SimmonsWorkforce Management Analyst, Murphy USAAuthor Commented:
Perfect, ty!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now