Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 24
Default Counting with two criterias

I have a list like this

A B
Var1 Item1
Var2 Item1
Var3 Item2
Var1 Item2
Var3 Item1
Var1 Item1

I would like to count the number of items in Column . Each item can be counted more than once, but only if the name in column a is different. In this case the resultat should be 5 as the last row has same name and Item number as a previous row and is already counted.

Jan
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Counting with two criterias

Daddy Sage wrote:

I have a list like this

A B C
Var1 Item1 Var1Item1
Var2 Item1 Var2Item1
Var3 Item2 Var3Item2
Var1 Item2 Var1Item2
Var3 Item1 Var3Item1
Var1 Item1 Var1Item1

I would like to count the number of items in Column . Each item can be
counted more than once, but only if the name in column a is different. In
this case the resultat should be 5 as the last row has same name and Item
number as a previous row and is already counted.


Make a column C = A&B and count in that column.


--
Vie : n.f. maladie mortelle sexuellement transmissible
Benoit chez lui à leraillez.com
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 24
Default Counting with two criterias

onsdag den 2. oktober 2019 kl. 19.01.11 UTC+2 skrev Benoît:
Daddy Sage wrote:

I have a list like this

A B C
Var1 Item1 Var1Item1
Var2 Item1 Var2Item1
Var3 Item2 Var3Item2
Var1 Item2 Var1Item2
Var3 Item1 Var3Item1
Var1 Item1 Var1Item1

I would like to count the number of items in Column . Each item can be
counted more than once, but only if the name in column a is different. In
this case the resultat should be 5 as the last row has same name and Item
number as a previous row and is already counted.


Make a column C = A&B and count in that column.


--
Vie : n.f. maladie mortelle sexuellement transmissible
Benoit chez lui Ã* leraillez.com


I can do that, but it will still count all and duplicates are not to be counted more than once.
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 24
Default Counting with two criterias

onsdag den 2. oktober 2019 kl. 22.36.26 UTC+2 skrev Daddy Sage:
onsdag den 2. oktober 2019 kl. 19.01.11 UTC+2 skrev Benoît:
Daddy Sage wrote:

I have a list like this

A B C
Var1 Item1 Var1Item1
Var2 Item1 Var2Item1
Var3 Item2 Var3Item2
Var1 Item2 Var1Item2
Var3 Item1 Var3Item1
Var1 Item1 Var1Item1

I would like to count the number of items in Column . Each item can be
counted more than once, but only if the name in column a is different.. In
this case the resultat should be 5 as the last row has same name and Item
number as a previous row and is already counted.


Make a column C = A&B and count in that column.


--
Vie : n.f. maladie mortelle sexuellement transmissible
Benoit chez lui Ã* leraillez.com


I can do that, but it will still count all and duplicates are not to be counted more than once.


I found an array formula that will do the trick, but now I wonder if it cn be done without the additional column, that is using oly A and B?

=SUM(IF(C1:C17<"",1/COUNTIF(C1:C17,C1:C17), 0))

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default Counting with two criterias

Hi,

Am Wed, 2 Oct 2019 14:28:24 -0700 (PDT) schrieb Daddy Sage:

I found an array formula that will do the trick, but now I wonder if it cn be done without the additional column, that is using oly A and B?

=SUM(IF(C1:C17<"",1/COUNTIF(C1:C17,C1:C17), 0))


try:

=SUMPRODUCT((MATCH(A1:A99&"x"&B1:B99,A1:A99&"x"&B1 :B99,0)=ROW(1:99))*1)-1


Regards
Claus B.
--
Windows10
Office 2016


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Counting with two criterias

Daddy Sage wrote:

onsdag den 2. oktober 2019 kl. 19.01.11 UTC+2 skrev Benoît:
Daddy Sage wrote:

I have a list like this

A B C
Var1 Item1 Var1Item1
Var2 Item1 Var2Item1
Var3 Item2 Var3Item2
Var1 Item2 Var1Item2
Var3 Item1 Var3Item1
Var1 Item1 Var1Item1

I would like to count the number of items in Column . Each item can be
counted more than once, but only if the name in column a is different.
In this case the resultat should be 5 as the last row has same name
and Item number as a previous row and is already counted.


Make a column C = A&B and count in that column.


I can do that, but it will still count all and duplicates are not to be
counted more than once.


Take a look at :

https://www.ablebits.com/office-addi...lues-in-excel/

--
Vie : n.f. maladie mortelle sexuellement transmissible
Benoit chez lui à leraillez.com
  #7   Report Post  
Junior Member
 
Posts: 3
Default

If you can re-arrange the columns, and sort by colA, then colB, the problem becomes much easier:

Var1 Item1 =1
Var1 Item1 =if((A2 = A1,if(B2 = B1,0,1)
Var1 Item2 {copy)
Var2 Item1 {copy)
Var3 Item2 {copy)
Var3 Item1 {copy)

Answer = sum(C1:C6)
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
Help with Counting Multiple Criterias Munster Excel Programming 2 March 15th 17 06:45 PM
Help with counting two different criterias. Jboo Excel Discussion (Misc queries) 9 February 24th 09 08:50 PM
If Criterias Ricardo Excel Discussion (Misc queries) 3 April 5th 07 01:06 PM
Counting instances based on two criterias [email protected] Excel Worksheet Functions 7 June 5th 06 07:18 PM
Counting cells if special criterias are true a94andwi Excel Worksheet Functions 12 May 2nd 06 07:07 AM


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