You are here:

Excel/Count specific dates in cell range for current month

Advertisement


Question
I have failed to build a working formula for 2003, I have a spread sheet and in column E3:E99 I have entered dates (Appointments)-- on a separate summery sheet I would like to see how many appointments I have scheduled for the current month. I am looking to tie the "valid" count criteria to my computer clock (RTC). In other words I only want to only count the appointments I have in the current month when I open the spreadsheet. My current formatted date is MM/DD/YY. I do not want to count any dates in the selected cells unless they are in the current month and year. Or at least the current month. I am in real need of a sanity check.
The closest I have gotten to a working formula is
=SUMPRODUCT(MONTH(E3:E99=MONTH(NOW())) (This is obviously not correct)


Answer
Ron:

I apologize for the slightly slow response (I usually like to reply within a few hours; however, I was out of the office today running errands and I just got home).

You were VERY close with your formula - you definitely understood what needed to be done and were simply off on the syntax.  

There is a bad parenthesis placement and, based on how the formula works since it is a TRUE/FALSE situation, you need to multiply by 1 somewhere in the formula to convert the TRUES to 1 and the FALSES to 0.  Here is a revised formula:

=SUMPRODUCT((MONTH(E3:E99)=MONTH(NOW()))*1)

Now, if you want to ensure you only have appointments in the same year and month then you would want to use this function:

=SUMPRODUCT((MONTH(E3:E99)=MONTH(NOW()))*(YEAR(E3:E99)=YEAR(NOW()))*1)

Please let me know if you have any additional questions.
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Nathan Head

Expertise

Microsoft Excel questions related to advanced formulas, Pivot Tables, filters, forms, graphs, and just about anything else (EXCEPT Visual Basic Coding/Programming and Macros, I don't answer questions in those categories).


This expert requests a donation of $3 for questions answered to your satisfaction. Isn't $3 a value for this experts time?

Experience

I have been using spreadsheets since Lotus 1-2-3 was released. As a CPA, I use spreadsheets every day at work.

Education/Credentials
CPA, Texas

©2012 About.com, a part of The New York Times Company. All rights reserved.