Excel Function Help

Shayughul

n00b
Joined
Jun 28, 2004
Messages
60
So I have a spreadsheet with 4 columns.

Name | Type | Date | Number

I am looking for a way in Excel 97 to write a function that will count based on 2 criteria. I know the COUNTIF function does not allow that but I was wondering if there is a way to do this.

Basically I will have a months worth of data on the spread sheet and I need to do type counts based on a per week basis. I would like to automate it so that I can get a count of each type per person. So if I have a range of dates from 2/1/2009 to 2/20/2009 and I only want to count the ones from 2/1/2009 to 2/7/2009 on a per person basis. Is this even possible without VBA. If I am going to have to use VBA anybody have some good links to tutorial sites?

TIA
 
The only way I know to do this is via Excel's DCount function. This requires a section on your spreadsheet with the same column titles as your data range. This section allows you to put in multiple criteria ranges allowing you to do what I think you're talking about.
 
use an additional column. put an AND in to test your two conditions. then use countif to find the number of trues. then hide the column with your if statement to give a better appearance.
 
This is kind of a dirty way but try...

=COUNTIF(A1:A30,(">1/31/2009"))+COUNTIF(A1:A30,("<2/8/2009"))-COUNT(A1:A30)

Where A1:A30 is the range containing your data.

The formula gets the number of dates that satisfies the lower criteria and adds it to the number of dates that satisfies the upper criteria. It then subtracts the number of dates that you are searching within.

This should give you the number of dates that fall within your two date ranges.
Notice the lower range is the day prior to your lower criteria and the upper range is the date following your upper criteria.

Dennis
 
Back
Top