Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default Referencing previous column in COUNTIF

Evening All,

I am a novice Excel user, so please excuse the probably very basic
question. I have a spreadsheet with two columns, e.g.

A E
D E
F L
A E
G E

I am trying to get some totals for column 2 based on the value, so I
used COUNTIF(D4:D34, "E"). This is great, but I only want to count
column 2 if the corresponding cell in column 1 is "A" (or not "A" for
my other total). I think I want to somehow use INDIRECT as well, but
can't quite figure out how! The total I am looking for in the example
would be 2 (col2="E" and col1="A").

Thanks for any hints/advice.

Cheers,
Al.

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

=SUMPRODUCT(--(A1:A10="A"),--(B1:B10-"E"))

--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
oups.com...
Evening All,

I am a novice Excel user, so please excuse the probably very basic
question. I have a spreadsheet with two columns, e.g.

A E
D E
F L
A E
G E

I am trying to get some totals for column 2 based on the value, so I
used COUNTIF(D4:D34, "E"). This is great, but I only want to count
column 2 if the corresponding cell in column 1 is "A" (or not "A" for
my other total). I think I want to somehow use INDIRECT as well, but
can't quite figure out how! The total I am looking for in the example
would be 2 (col2="E" and col1="A").

Thanks for any hints/advice.

Cheers,
Al.



  #3   Report Post  
Jambruins
 
Posts: n/a
Default

Try this:

=countif(D4:D34, "E") + countif(A4:A34, "A")



" wrote:

Evening All,

I am a novice Excel user, so please excuse the probably very basic
question. I have a spreadsheet with two columns, e.g.

A E
D E
F L
A E
G E

I am trying to get some totals for column 2 based on the value, so I
used COUNTIF(D4:D34, "E"). This is great, but I only want to count
column 2 if the corresponding cell in column 1 is "A" (or not "A" for
my other total). I think I want to somehow use INDIRECT as well, but
can't quite figure out how! The total I am looking for in the example
would be 2 (col2="E" and col1="A").

Thanks for any hints/advice.

Cheers,
Al.


  #4   Report Post  
Domenic
 
Posts: n/a
Default

Try the following...

=SUMPRODUCT(--(C4:C34="A"),--(D4:D34="E"))

Hope this helps!

In article .com,
" wrote:

Evening All,

I am a novice Excel user, so please excuse the probably very basic
question. I have a spreadsheet with two columns, e.g.

A E
D E
F L
A E
G E

I am trying to get some totals for column 2 based on the value, so I
used COUNTIF(D4:D34, "E"). This is great, but I only want to count
column 2 if the corresponding cell in column 1 is "A" (or not "A" for
my other total). I think I want to somehow use INDIRECT as well, but
can't quite figure out how! The total I am looking for in the example
would be 2 (col2="E" and col1="A").

Thanks for any hints/advice.

Cheers,
Al.

  #5   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

=SUMPRODUCT(--(A2:A100="A"),--(B2:B100="E"))

will count "E" in B where A is "A"


--

Regards,

Peo Sjoblom


wrote in message
oups.com...
Evening All,

I am a novice Excel user, so please excuse the probably very basic
question. I have a spreadsheet with two columns, e.g.

A E
D E
F L
A E
G E

I am trying to get some totals for column 2 based on the value, so I
used COUNTIF(D4:D34, "E"). This is great, but I only want to count
column 2 if the corresponding cell in column 1 is "A" (or not "A" for
my other total). I think I want to somehow use INDIRECT as well, but
can't quite figure out how! The total I am looking for in the example
would be 2 (col2="E" and col1="A").

Thanks for any hints/advice.

Cheers,
Al.





  #6   Report Post  
 
Posts: n/a
Default

Thanks everyone for all your help there - superb! Just one question,
what does '--(C4:C34="A")' do - is it some method of creating an array
from the cells?

Thanks again,
Al.

  #7   Report Post  
Bob Phillips
 
Posts: n/a
Default

See http://www.xldynamic.com/source/xld.SUMPRODUCT.html for an explanation

--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
oups.com...
Thanks everyone for all your help there - superb! Just one question,
what does '--(C4:C34="A")' do - is it some method of creating an array
from the cells?

Thanks again,
Al.



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
How do I sort by row instead of by column? PercivalMound Excel Worksheet Functions 7 August 28th 06 10:41 PM
Data in column predetermined by what has been entered in previous zan123 Excel Discussion (Misc queries) 6 February 23rd 05 08:03 PM
How do you use countif for several column criteria? Fustrated Excel Worksheet Functions 1 February 9th 05 05:30 PM
Countif (same as previous) TT Excel Worksheet Functions 2 November 23rd 04 11:34 PM
Countif - Countif maswinney Excel Worksheet Functions 3 November 15th 04 11:06 PM


All times are GMT +1. The time now is 07:39 AM.

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"