#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Formula

I need help with a formula for the following:

Column A Column B
1 SEC
1 DEA
1 SEC
2
2
3
2

I need to count the number of SEC in Column B only if there is a
corresponding "1" in Column A. In this instance the answer would be 2.

All help would be appreciated.

Thank you

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Formula



"Autumn Dreams" wrote:

I need help with a formula for the following:

Column A Column B
1 SEC
1 DEA
1 SEC
2
2
3
2

I need to count the number of SEC in Column B only if there is a
corresponding "1" in Column A. In this instance the answer would be 2.

All help would be appreciated.

Thank you


You need to count the number of "true" cases for the existence of a logical
relationship. This cannot be done with COUNT() "out of the box."

The best way to handle this (and it happens a lot) is to create a new column
that contains a formula for creating and containing the test results, and
then COUNTing the derived column.

Create a column to the left of your example with the following formula in
each cell:

=AND(A1="1",B1="SEC")

This should always resolve to TRUE or FALSE. Then COUNT the number of TRUE
values in the new column.

This is simply an example. There are a dozen variations of this that you
could use just a well and perhaps even better.

B+
HALinNY
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Formula

Thank you. My apologies for not being clearer. I would then need to count
all the DEA with a corresponding "1". There are several of these to count.

Thank you.

"HALinNY" wrote:



"Autumn Dreams" wrote:

I need help with a formula for the following:

Column A Column B
1 SEC
1 DEA
1 SEC
2
2
3
2

I need to count the number of SEC in Column B only if there is a
corresponding "1" in Column A. In this instance the answer would be 2.

All help would be appreciated.

Thank you


You need to count the number of "true" cases for the existence of a logical
relationship. This cannot be done with COUNT() "out of the box."

The best way to handle this (and it happens a lot) is to create a new column
that contains a formula for creating and containing the test results, and
then COUNTing the derived column.

Create a column to the left of your example with the following formula in
each cell:

=AND(A1="1",B1="SEC")

This should always resolve to TRUE or FALSE. Then COUNT the number of TRUE
values in the new column.

This is simply an example. There are a dozen variations of this that you
could use just a well and perhaps even better.

B+
HALinNY

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Formula



"Autumn Dreams" wrote:

Thank you. My apologies for not being clearer. I would then need to count
all the DEA with a corresponding "1". There are several of these to count.

Thank you.


Not a problem. This kind of thing happens all the time. Instead of the
formula I used before, use this one ...

=A1&B1

This will give you values like "1SEC" and "2DEA"

Then you can COUNT the number of cells containing the particular string you
are interested in.

B+
HALinNY

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 964
Default Formula

Another option, that wouldn't require any additional columns would be:

=SUMPRODUCT((A1:A100=1)*(B1:B100="SEC"))

HTH,
Elkar


"Autumn Dreams" wrote:

Thank you. My apologies for not being clearer. I would then need to count
all the DEA with a corresponding "1". There are several of these to count.

Thank you.

"HALinNY" wrote:



"Autumn Dreams" wrote:

I need help with a formula for the following:

Column A Column B
1 SEC
1 DEA
1 SEC
2
2
3
2

I need to count the number of SEC in Column B only if there is a
corresponding "1" in Column A. In this instance the answer would be 2.

All help would be appreciated.

Thank you


You need to count the number of "true" cases for the existence of a logical
relationship. This cannot be done with COUNT() "out of the box."

The best way to handle this (and it happens a lot) is to create a new column
that contains a formula for creating and containing the test results, and
then COUNTing the derived column.

Create a column to the left of your example with the following formula in
each cell:

=AND(A1="1",B1="SEC")

This should always resolve to TRUE or FALSE. Then COUNT the number of TRUE
values in the new column.

This is simply an example. There are a dozen variations of this that you
could use just a well and perhaps even better.

B+
HALinNY

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
Reusing formula Tony29 Excel Discussion (Misc queries) 7 September 7th 06 03:34 AM
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM


All times are GMT +1. The time now is 02:52 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"