count with multiple critirea

M

MANYHEADACHES

I have a worksheet that contains a date range in column B, and a reason code
(text) in column E. I am trying to count the number of times a reson code is
used for each date. I.E on 1/30/09 how many cells in column E contain reason
"XYZ". Each day a file is created with these exact column headings. The name
of the files is always that days date (Pulled file today so the name of the
file would be todays date). I want to be able to enter a formula in a
seperate workbook that will give me these counts for each days file by
changing the name of the file it references. I hope someone understands this
and can help me, cuz I have spent days messing with array formulas, COUNTIF,
COUNT IF, SUM IF, SUMIF and none of them will work, they all give me the
counts of both that meet the date and the reason code together. That is not
what I am trying to accomplish. SOMONE PLEASE HELP ME!!! THANK YOU IN
ADVANCE!!!!
 
J

JBeaucaire

The only thing I needed to add was a cell that holds the date you want to
collect the data for. So I put that in Q1, then next to it in R1 you can put
this formula:

=SUMPRODUCT(--($B$2:$B$100=Q1),--($E$2:$E$100="XYZ"))
 
J

JBeaucaire

This formula will count all the XYZ in column E of a file called
"01-30-2009"...edit as needed:

=COUNTIF([01-30-2009.xls]Sheet1!$E$2:$E$100,"XYZ")
 
J

JBeaucaire

If you're talking about changing the entry in a cell to a particular date and
having the adjacent cell tell you how many XYZ are in that file's column E,
the only way to do that is with an INDIRECT function. INDIRECT would let you
insert a cell's value into the middle of a formula to dynamically change it.

The problem is that you can't use INDIRECT to reference a closed workbook,
which i am sure is what you are wanting to do, right? All the dated workbooks
are closed?

If the dated workbooks are open, then this would work with the cell A2
housing the name of the workbook to open:

=COUNTIF(INDIRECT("["&A2&".xls]Sheet1!$E$2:$E$100"),"XYZ")

To get around the problem, you will have to use an Addin called MoreFunc.
The addin function is called Indirect.ext and you can read up on it here:

http://xcell05.free.fr/morefunc/english/indirect.ext.htm

Read here for the overview of the entire array of addins that come with
this, as well as find the download link:

http://xcell05.free.fr/morefunc/english/index.htm
--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


JBeaucaire said:
This formula will count all the XYZ in column E of a file called
"01-30-2009"...edit as needed:

=COUNTIF([01-30-2009.xls]Sheet1!$E$2:$E$100,"XYZ")

--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


JBeaucaire said:
The only thing I needed to add was a cell that holds the date you want to
collect the data for. So I put that in Q1, then next to it in R1 you can put
this formula:

=SUMPRODUCT(--($B$2:$B$100=Q1),--($E$2:$E$100="XYZ"))
 
S

Shane Devenshire

Hi,

You can't use COUNTIF for two conditions but in 2007 you can use COUNTIFS as
follows:

=COUNTIFS('[Quick Parts.xlsm]Conditional Formatting'!$B$1:$B$11,A8,'[Quick
Parts.xlsm]Conditional Formatting'!$E$1:$E$11,B8)

Where B8 contains the date and A8 the reason code you want to count.

FYI - It is bad newsgroup practice to post the same question twice.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top