?
Solved

EXCEL - Sumproduct using AND statement?

Posted on 2016-10-25
6
Medium Priority
?
54 Views
Last Modified: 2016-10-26
First post, let's get to it!

I use a formula like this in my sheet -

=(SUMPRODUCT(--(TEXT(Sales[Date],"mmmm")=E$2),Sales[Total]))


This grabs a number if the value matches my columns month.

My problem is last years data is being added in again for last october, so I need a way to make it check for month and year.

I have many sheets, each for a different stage of business. Lets say I sold a product, I store that sale as 10/25/2016. Then, I have a summary sheet, which uses the sumproduct to retrieve this data later.

How can I change the formula up top to reflect this? I could add the current year somewhere in an open cell.

Open to ideas if there's an easier way using a totally different formula too! Thanks!
0
Comment
Question by:steve bartels
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 41859648
you can try formula:
=(SUMPRODUCT(--(TEXT(Sales[Date],"mmmm yy")=E$2),Sales[Total]))

Open in new window


and make sure E$2 returns something like: October 16 instead.
0
 

Author Comment

by:steve bartels
ID: 41859661
It doesn't work. I'm not sure how you intended to format F2. "November 16". Reformats to Custom "16-Nov"

 Here's a screenshot
ss--2016-10-25-at-08.40.59-.png
0
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 41859671
what if you trying this instead?
=(SUMPRODUCT(--(TEXT(Example[Date],"mmmm yy")=F$1),Example[Total]))

Open in new window

you can also attached a sample here so that we can diagnose the issue for you.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 32

Accepted Solution

by:
Subodh Tiwari (Neeraj) earned 2000 total points
ID: 41859707
Try this.....

=SUMPRODUCT((TEXT(Example[Date],"yyyymmmm")=E$1&F$1)*Example[Cost])

Open in new window

0
 

Author Comment

by:steve bartels
ID: 41860986
You did it, Subodh Tiwari (Neeraj)! Thank you!!
0
 
LVL 32

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41861066
You're welcome Steve! Glad to help.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question