Solved

SUMIF with a date criteria as well

Posted on 2011-09-24
2
558 Views
Last Modified: 2012-05-12
I have a simple SUMIF which totals a column of cells based on a matching name:

Sheet2!B3     =SUMIF(Sheet1!A:A,A3,Sheet1!D:D)

This is for training courses which have a 'Course Date' (Sheet1!E:E) date cell. Sheet2!B1:M1 contains a heading of Months.

I need the SUMIF to total the values in Sheet1!D:D but also, only if the course date matches the same month as the heading in Sheet2!B1:B12.

I hope this, and the attached example spreadsheet (Excel 2003), makes some sense! So far I've tried SUMPRODUCT, SUMIF's, IF's and AND's, INDEX and MATCH, and I'm sure I've almost been there, but I can't find the right combination!

Thanks,
Lee

 EE-Example.xls
0
Comment
Question by:Lee Osborne
2 Comments
 
LVL 50

Accepted Solution

by:
teylyn earned 500 total points
ID: 36592118
Hello,

you could do a pivot table with just a few clicks, or use sumproduct

=SUMPRODUCT(--(Sheet1!$A$2:$A$20=Sheet2!$A3),--(DATE(YEAR(Sheet1!$E$2:$E$20),MONTH(Sheet1!$E$2:$E$20),1)=Sheet2!B$1),Sheet1!$D$2:$D$20)

Attached is the sumproduct formula in action and a pivot table on Sheet3

cheers, teylyn
EE-Example.xls
0
 
LVL 15

Author Comment

by:Lee Osborne
ID: 36592185
Perfect, thanks very much!

I really should learn more about pivot tables, they really are good!

Lee
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

943 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now