Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 58
Default Critical Counitif formula

Hi,

I have 2 cols and i want to count the duplicates comparing 2nd col values, i
am requesting you to read the below example to understand better.

Ex :

A B C D
ABC Y 5
ABC X 4
ABC X
ABC X
ABC X
DEF Y 7
DEF Y
DEF Y
DEF X 2
DEF Z
DEF Z
DEF X

Pls. refer the above ex, col A has values repeated and col B has some value
like X, Y, Z. I am trying to count the values in col A and mention the count
at the 1st occurence. Pls. refer col. C (Total ABC count is 5 so it is
returning the value in the 1st line, same way DEF count is 7 and it returns
count in the 1st accurence (6th Row) so iused the formula as
=if(countif(A$:A2,A2)1,"",countif($A$2:$A$100,A2) ) and it worked fine.

Now I am trying to add 1 more condition, like give me the total count of the
values in col A only when the value is X in col B. Reject the count where the
value < X in col B.

So as per above example total ABC count is 5 but in 1 row B col value is Y
so it shud return the count of ABC as 4 in the first occurence of X (in row
2), same way total count of DEF is 7 value X is available in row 9 & 12 so it
shud return the value as 2 in the 1st occurence where the value is X in col B
(in row 9)

I am extremely sorry to explian you in this manner, pls. let me know if u
have any clarifications. Looking forward for your help. Thanks in Advance!!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,805
Default Critical Counitif formula

=SUMPRODUCT(--(A1:A100="ABC"),--(B1:B100="X"))
will give you the count of rows with ABC in Col A and X in Col B

You can replace the values by reference to Cells like
=SUMPRODUCT(--(A1:A100=A1),--(B1:B100=B1))

"Christopher Naveen" wrote:

Hi,

I have 2 cols and i want to count the duplicates comparing 2nd col values, i
am requesting you to read the below example to understand better.

Ex :

A B C D
ABC Y 5
ABC X 4
ABC X
ABC X
ABC X
DEF Y 7
DEF Y
DEF Y
DEF X 2
DEF Z
DEF Z
DEF X

Pls. refer the above ex, col A has values repeated and col B has some value
like X, Y, Z. I am trying to count the values in col A and mention the count
at the 1st occurence. Pls. refer col. C (Total ABC count is 5 so it is
returning the value in the 1st line, same way DEF count is 7 and it returns
count in the 1st accurence (6th Row) so iused the formula as
=if(countif(A$:A2,A2)1,"",countif($A$2:$A$100,A2) ) and it worked fine.

Now I am trying to add 1 more condition, like give me the total count of the
values in col A only when the value is X in col B. Reject the count where the
value < X in col B.

So as per above example total ABC count is 5 but in 1 row B col value is Y
so it shud return the count of ABC as 4 in the first occurence of X (in row
2), same way total count of DEF is 7 value X is available in row 9 & 12 so it
shud return the value as 2 in the 1st occurence where the value is X in col B
(in row 9)

I am extremely sorry to explian you in this manner, pls. let me know if u
have any clarifications. Looking forward for your help. Thanks in Advance!!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 857
Default Critical Counitif formula

Hi,

See if these meet your needs:

=IF(A2=A1,"",COUNTIF(A$2:A$13,A2))

=IF(COUNTIFS($A$2:$A2,A2,$B$2:$B2,"x")=1,IF(B2="x" ,COUNTIFS(A2:A$13,A2,B2:$B$13,"x"),""),"")

In both cases I am assuming the data starts on row 2. Adjust the references
to suit.

The first solution works in 2003 or 07, the second one only in 2007
--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Christopher Naveen" wrote:

Hi,

I have 2 cols and i want to count the duplicates comparing 2nd col values, i
am requesting you to read the below example to understand better.

Ex :

A B C D
ABC Y 5
ABC X 4
ABC X
ABC X
ABC X
DEF Y 7
DEF Y
DEF Y
DEF X 2
DEF Z
DEF Z
DEF X

Pls. refer the above ex, col A has values repeated and col B has some value
like X, Y, Z. I am trying to count the values in col A and mention the count
at the 1st occurence. Pls. refer col. C (Total ABC count is 5 so it is
returning the value in the 1st line, same way DEF count is 7 and it returns
count in the 1st accurence (6th Row) so iused the formula as
=if(countif(A$:A2,A2)1,"",countif($A$2:$A$100,A2) ) and it worked fine.

Now I am trying to add 1 more condition, like give me the total count of the
values in col A only when the value is X in col B. Reject the count where the
value < X in col B.

So as per above example total ABC count is 5 but in 1 row B col value is Y
so it shud return the count of ABC as 4 in the first occurence of X (in row
2), same way total count of DEF is 7 value X is available in row 9 & 12 so it
shud return the value as 2 in the 1st occurence where the value is X in col B
(in row 9)

I am extremely sorry to explian you in this manner, pls. let me know if u
have any clarifications. Looking forward for your help. Thanks in Advance!!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 857
Default Critical Counitif formula

Hi,

And here is the 2003 version of the second formula:

=IF(SUMPRODUCT(--($A$2:$A2=A2),--($B$2:$B2="x"))=1,IF(B2="x",SUMPRODUCT(--(A2:A$13=A2),--(B2:$B$13="x")),""),"")

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Christopher Naveen" wrote:

Hi,

I have 2 cols and i want to count the duplicates comparing 2nd col values, i
am requesting you to read the below example to understand better.

Ex :

A B C D
ABC Y 5
ABC X 4
ABC X
ABC X
ABC X
DEF Y 7
DEF Y
DEF Y
DEF X 2
DEF Z
DEF Z
DEF X

Pls. refer the above ex, col A has values repeated and col B has some value
like X, Y, Z. I am trying to count the values in col A and mention the count
at the 1st occurence. Pls. refer col. C (Total ABC count is 5 so it is
returning the value in the 1st line, same way DEF count is 7 and it returns
count in the 1st accurence (6th Row) so iused the formula as
=if(countif(A$:A2,A2)1,"",countif($A$2:$A$100,A2) ) and it worked fine.

Now I am trying to add 1 more condition, like give me the total count of the
values in col A only when the value is X in col B. Reject the count where the
value < X in col B.

So as per above example total ABC count is 5 but in 1 row B col value is Y
so it shud return the count of ABC as 4 in the first occurence of X (in row
2), same way total count of DEF is 7 value X is available in row 9 & 12 so it
shud return the value as 2 in the 1st occurence where the value is X in col B
(in row 9)

I am extremely sorry to explian you in this manner, pls. let me know if u
have any clarifications. Looking forward for your help. 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
Formula for Cochran's Critical Values Dave Curtis[_2_] Excel Worksheet Functions 8 October 7th 15 10:15 PM
Critical requirement. Christopher Naveen[_2_] Excel Worksheet Functions 3 June 22nd 08 01:19 PM
Critical graph derdle Excel Discussion (Misc queries) 3 October 31st 06 09:19 PM
Why did I get an unexpected critical error? Lynkwright Excel Discussion (Misc queries) 1 January 20th 06 04:45 PM
Critical thinking puzzle jazbath Excel Discussion (Misc queries) 8 December 12th 05 08:05 PM


All times are GMT +1. The time now is 03:00 AM.

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

About Us

"It's about Microsoft Excel"