Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
maxtrixx
 
Posts: n/a
Default Combining IF and COUNTIF based on two columns

Here is what I'm trying to do, I have two colums with data, the first column
will have one of four letters (A, B, C, D) the second column will have one of
two numbers (0, 1). I need to get 6 different counts:

COUNTIF column A range A1:A250 is A
COUNTIF column A is range A1:A250 B
COUNTIF column A is range A1:A250 C
COUNTIF column A is range A1:A250 D
COUNT column A ONLY IF column B range B1:B250 is 0
COUNT column A ONLY IF cloumn B range B1:B250 is 1

I can do the first 4 calculations pretty easy but am having a hard time
figuring out how to do the last two calculations. Can anyone help me?
Thanks in advance.
  #2   Report Post  
Duke Carey
 
Posts: n/a
Default

try

=SUMPRODUCT(--(A1:A250="A"),--(B1:B250=0))

"maxtrixx" wrote:

Here is what I'm trying to do, I have two colums with data, the first column
will have one of four letters (A, B, C, D) the second column will have one of
two numbers (0, 1). I need to get 6 different counts:

COUNTIF column A range A1:A250 is A
COUNTIF column A is range A1:A250 B
COUNTIF column A is range A1:A250 C
COUNTIF column A is range A1:A250 D
COUNT column A ONLY IF column B range B1:B250 is 0
COUNT column A ONLY IF cloumn B range B1:B250 is 1

I can do the first 4 calculations pretty easy but am having a hard time
figuring out how to do the last two calculations. Can anyone help me?
Thanks in advance.

  #3   Report Post  
maxtrixx
 
Posts: n/a
Default

Awesome, thank you, works like a charm. Now is it possible to include some
date ranges like from 1/1/2005 to 1/31/2005? I need this by month. I forgot
to include that in the original question.

"Duke Carey" wrote:

try

=SUMPRODUCT(--(A1:A250="A"),--(B1:B250=0))

"maxtrixx" wrote:

Here is what I'm trying to do, I have two colums with data, the first column
will have one of four letters (A, B, C, D) the second column will have one of
two numbers (0, 1). I need to get 6 different counts:

COUNTIF column A range A1:A250 is A
COUNTIF column A is range A1:A250 B
COUNTIF column A is range A1:A250 C
COUNTIF column A is range A1:A250 D
COUNT column A ONLY IF column B range B1:B250 is 0
COUNT column A ONLY IF cloumn B range B1:B250 is 1

I can do the first 4 calculations pretty easy but am having a hard time
figuring out how to do the last two calculations. Can anyone help me?
Thanks in advance.

  #4   Report Post  
Duke Carey
 
Posts: n/a
Default

Thanks for the feedback.

As for the second question, adjust this formula to reflect your ranges

=SUMPRODUCT(--(A1:A250="A"),--(B1:B250=1),--(MONTH(C1:C250)=1))

Duke

"maxtrixx" wrote:

Awesome, thank you, works like a charm. Now is it possible to include some
date ranges like from 1/1/2005 to 1/31/2005? I need this by month. I forgot
to include that in the original question.

"Duke Carey" wrote:

try

=SUMPRODUCT(--(A1:A250="A"),--(B1:B250=0))

"maxtrixx" wrote:

Here is what I'm trying to do, I have two colums with data, the first column
will have one of four letters (A, B, C, D) the second column will have one of
two numbers (0, 1). I need to get 6 different counts:

COUNTIF column A range A1:A250 is A
COUNTIF column A is range A1:A250 B
COUNTIF column A is range A1:A250 C
COUNTIF column A is range A1:A250 D
COUNT column A ONLY IF column B range B1:B250 is 0
COUNT column A ONLY IF cloumn B range B1:B250 is 1

I can do the first 4 calculations pretty easy but am having a hard time
figuring out how to do the last two calculations. Can anyone help me?
Thanks in advance.

  #5   Report Post  
maxtrixx
 
Posts: n/a
Default

Duke,

I understand the MONTH function and it works on individual cells but it
doesn't work inside the SUMPRODUCT function. I have the column where the
dates are formated to Date in the 3/1498 format. Do you know how to get
around this? Thanks again for the quick reply.

"Duke Carey" wrote:

Thanks for the feedback.

As for the second question, adjust this formula to reflect your ranges

=SUMPRODUCT(--(A1:A250="A"),--(B1:B250=1),--(MONTH(C1:C250)=1))

Duke

"maxtrixx" wrote:

Awesome, thank you, works like a charm. Now is it possible to include some
date ranges like from 1/1/2005 to 1/31/2005? I need this by month. I forgot
to include that in the original question.

"Duke Carey" wrote:

try

=SUMPRODUCT(--(A1:A250="A"),--(B1:B250=0))

"maxtrixx" wrote:

Here is what I'm trying to do, I have two colums with data, the first column
will have one of four letters (A, B, C, D) the second column will have one of
two numbers (0, 1). I need to get 6 different counts:

COUNTIF column A range A1:A250 is A
COUNTIF column A is range A1:A250 B
COUNTIF column A is range A1:A250 C
COUNTIF column A is range A1:A250 D
COUNT column A ONLY IF column B range B1:B250 is 0
COUNT column A ONLY IF cloumn B range B1:B250 is 1

I can do the first 4 calculations pretty easy but am having a hard time
figuring out how to do the last two calculations. Can anyone help me?
Thanks in advance.



  #6   Report Post  
maxtrixx
 
Posts: n/a
Default

I cleaned up the column and it worked perfectly. I imported the data from a
text file and some of the fields had a "." in them so that's where the error
was. Thank you very much!!

"Duke Carey" wrote:

Thanks for the feedback.

As for the second question, adjust this formula to reflect your ranges

=SUMPRODUCT(--(A1:A250="A"),--(B1:B250=1),--(MONTH(C1:C250)=1))

Duke

"maxtrixx" wrote:

Awesome, thank you, works like a charm. Now is it possible to include some
date ranges like from 1/1/2005 to 1/31/2005? I need this by month. I forgot
to include that in the original question.

"Duke Carey" wrote:

try

=SUMPRODUCT(--(A1:A250="A"),--(B1:B250=0))

"maxtrixx" wrote:

Here is what I'm trying to do, I have two colums with data, the first column
will have one of four letters (A, B, C, D) the second column will have one of
two numbers (0, 1). I need to get 6 different counts:

COUNTIF column A range A1:A250 is A
COUNTIF column A is range A1:A250 B
COUNTIF column A is range A1:A250 C
COUNTIF column A is range A1:A250 D
COUNT column A ONLY IF column B range B1:B250 is 0
COUNT column A ONLY IF cloumn B range B1:B250 is 1

I can do the first 4 calculations pretty easy but am having a hard time
figuring out how to do the last two calculations. Can anyone help me?
Thanks in advance.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using COUNTIF to check values in multiple columns DTomSimpson Excel Worksheet Functions 2 March 29th 05 04:47 AM
counting cells (COUNTIF) based on two or more criteria Tricia S. Excel Worksheet Functions 10 March 17th 05 03:17 PM
want to count in two columns; countif (colA=x AND colB=y)? Heather Murch Excel Worksheet Functions 1 February 17th 05 04:47 PM
How do I perform a "Countif" function for Two Columns? Syed Ali Zubair Excel Worksheet Functions 2 February 8th 05 09:46 AM
combining countif formulas Liz G Excel Worksheet Functions 3 November 1st 04 10:34 PM


All times are GMT +1. The time now is 11:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"