Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 40
Default Count based on 2 conditions

I am using Excel 2003. Column B is the name of the account; column C is a
percentage for the month; column D returns the rank based on the percentage
in column c. Subsequent columns have the following month for a percentage for
that month and the next column is the rank

Column B Column C Column D Column E Column F
Jan Percent Rank Feb Percent
Rank
Account 1 85% 1 78%
2
Account 2 80% 2 82%
1

There are columns for 12 months of percentages and the corresponding columns
for the rank. A formula is needed to count the number of times an account has
a number 1 rank throughout the year, but not count those columns of months
that have not occured as existing formulas return a rank of 1 for each of the
accounts when the percentage is zero for the months that have no percentage.

Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 75
Default Count based on 2 conditions

=IF(AND(B20,C2=1),1,0)+IF(AND(D20,E2=1),1,0)+IF( AND(F20,G2=1),1,0)+IF(AND(H20,H2=1),1,0)+IF(AND( J20,K2=1),1,0) etc, etc.

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"Basenji" wrote:

I am using Excel 2003. Column B is the name of the account; column C is a
percentage for the month; column D returns the rank based on the percentage
in column c. Subsequent columns have the following month for a percentage for
that month and the next column is the rank

Column B Column C Column D Column E Column F
Jan Percent Rank Feb Percent
Rank
Account 1 85% 1 78%
2
Account 2 80% 2 82%
1

There are columns for 12 months of percentages and the corresponding columns
for the rank. A formula is needed to count the number of times an account has
a number 1 rank throughout the year, but not count those columns of months
that have not occured as existing formulas return a rank of 1 for each of the
accounts when the percentage is zero for the months that have no percentage.

Thank you.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default Count based on 2 conditions

There are 2 ways of achieving this:

1) Error trap the Ranks of 1 in months that haven't happened yet as this
will remove the need to include this exclusion as a count condition.
This ould be done, by something like:

=if(A1TODAY(),"",RANK(b2,c2:c12,0)

This checks whether your month (date in cell A1) is greater than the
current date and if it is will insert an empty string, otherwise return
a rank. If you do this, you can then just use a simple COUNTIF to count
the ranks of 1

2) Use a 2 condition count, with SUMPRODUCT,i.e.

=SUMPRODUCT(--(B1:B12=1),--(A1:A12<=TODAY()))

which counts the number of ranks of 1 in range A1:A12 but only for
months where the months/dates in A1:A12 is less than or equal today
(happened). This presupposes you have your month as a full date i.e.
dd/mm/yyyy, even if it is displated as mmm-yy.

Jason
--


Basenji wrote:
I am using Excel 2003. Column B is the name of the account; column C is a
percentage for the month; column D returns the rank based on the percentage
in column c. Subsequent columns have the following month for a percentage for
that month and the next column is the rank

Column B Column C Column D Column E Column F
Jan Percent Rank Feb Percent
Rank
Account 1 85% 1 78%
2
Account 2 80% 2 82%
1

There are columns for 12 months of percentages and the corresponding columns
for the rank. A formula is needed to count the number of times an account has
a number 1 rank throughout the year, but not count those columns of months
that have not occured as existing formulas return a rank of 1 for each of the
accounts when the percentage is zero for the months that have no percentage.

Thank you.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default Count based on 2 conditions

There are 2 ways of achieving this:

1) 'Empty string' trap the Ranks of 1 in months that haven't happened
yet as this will remove the need to include this exclusion as a
count condition. This could be done, by something like:

=if(A1TODAY(),"",RANK(b2,c2:c12,0)

Use something like the above in all your RANK forumlas. This checks
whether your month (date in cell A1) is greater than the current date
and if it is will insert an empty string, otherwise return a rank. If
you do this, you can then just use a simple COUNTIF to count the ranks
of 1, with no need to worry about months that haven't happened yet.

2) Use a 2 condition count, with SUMPRODUCT,i.e.

=SUMPRODUCT(--(B1:B12=1),--(A1:A12<=TODAY()))

which counts the number of ranks of 1 in range B1:B12 but only for
months where the months/dates in A1:A12 is less than or equal today
(happened). This presupposes you have your month stored as a full date
i.e. dd/mm/yyyy, even if it is displated as mmm-yy.

Jason
--


Basenji wrote:
I am using Excel 2003. Column B is the name of the account; column C is a
percentage for the month; column D returns the rank based on the percentage
in column c. Subsequent columns have the following month for a percentage for
that month and the next column is the rank

Column B Column C Column D Column E Column F
Jan Percent Rank Feb Percent
Rank
Account 1 85% 1 78%
2
Account 2 80% 2 82%
1

There are columns for 12 months of percentages and the corresponding columns
for the rank. A formula is needed to count the number of times an account has
a number 1 rank throughout the year, but not count those columns of months
that have not occured as existing formulas return a rank of 1 for each of the
accounts when the percentage is zero for the months that have no percentage.

Thank you.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 40
Default Count based on 2 conditions

Thank you. It accomplished what needed to be counted.

"Basenji" wrote:

I am using Excel 2003. Column B is the name of the account; column C is a
percentage for the month; column D returns the rank based on the percentage
in column c. Subsequent columns have the following month for a percentage for
that month and the next column is the rank

Column B Column C Column D Column E Column F
Jan Percent Rank Feb Percent
Rank
Account 1 85% 1 78%
2
Account 2 80% 2 82%
1

There are columns for 12 months of percentages and the corresponding columns
for the rank. A formula is needed to count the number of times an account has
a number 1 rank throughout the year, but not count those columns of months
that have not occured as existing formulas return a rank of 1 for each of the
accounts when the percentage is zero for the months that have no percentage.

Thank you.

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
Count based on 2 conditions by using vb Jon Excel Discussion (Misc queries) 0 December 14th 08 02:36 PM
Count based on Conditions shyamgnair Excel Worksheet Functions 1 October 15th 08 02:05 PM
Array - Count based on 3 conditions Matts Excel Discussion (Misc queries) 1 September 1st 08 05:33 PM
Count based on multiple conditions Ken Excel Discussion (Misc queries) 1 June 11th 07 09:50 PM
How do I count based on two conditions? Mark G New Users to Excel 2 January 31st 06 03:57 AM


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