EXCEL - Sumproduct using AND statement?

Posted on 2016-10-25
Last Modified: 2016-10-26
First post, let's get to it!

I use a formula like this in my sheet -


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!
Question by:steve bartels
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
LVL 51

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.

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
LVL 51

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.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 30

Accepted Solution

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


Open in new window


Author Comment

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

Expert Comment

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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

733 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