ProfitMajin
New Member
- Joined
- Feb 16, 2016
- Messages
- 7
Hi All,
Apologies if this is a repeat of another question, couldn't find one which quite matched...
I'm afraid I've reached the point where I must ask for assistance, I'm trying to count the number of rows in a given dataset which match a set of criteria, but specifically count the row only once.
The worksheets I'm working from record our customers' usage of the various areas of the product, and I'm trying to count the number of customers with usage, so we have a layout similar to the following:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Unique ID[/TD]
[TD]Name[/TD]
[TD]Stat1[/TD]
[TD]Stat2[/TD]
[TD]Stat3[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Customer1[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Customer2[/TD]
[TD]1[/TD]
[TD]0[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]
The trouble I'm having is that when I use =COUNTIF(C:C,">=1")+COUNTIF(D:D,">=1")+COUNTIF(E:E,">=1") it will count the cells, but if there is usage in two columns as above, it counts the row twice, and as such in the above example it returns 3, when it should return 2.
I did also try =COUNTIF(C:E,">=1") which worked the same as above, I used the longer version above in hopes it would count separately but alas
I've also tried =SUMPRODUCT((C:C>=1)+(D:D>=1)+(E:E>=1)) which also counts the cells, but of course adds the results together rather than count 1 per row.
I'm kinda hoping I've been incredibly silly with this, but after referencing several sources it seems I'm trying to use a 3D array which would naturally be more in depth than the above functions, I can provide real examples if it helps more.
Thank you all for your time!
Martin
Apologies if this is a repeat of another question, couldn't find one which quite matched...
I'm afraid I've reached the point where I must ask for assistance, I'm trying to count the number of rows in a given dataset which match a set of criteria, but specifically count the row only once.
The worksheets I'm working from record our customers' usage of the various areas of the product, and I'm trying to count the number of customers with usage, so we have a layout similar to the following:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Unique ID[/TD]
[TD]Name[/TD]
[TD]Stat1[/TD]
[TD]Stat2[/TD]
[TD]Stat3[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Customer1[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Customer2[/TD]
[TD]1[/TD]
[TD]0[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]
The trouble I'm having is that when I use =COUNTIF(C:C,">=1")+COUNTIF(D:D,">=1")+COUNTIF(E:E,">=1") it will count the cells, but if there is usage in two columns as above, it counts the row twice, and as such in the above example it returns 3, when it should return 2.
I did also try =COUNTIF(C:E,">=1") which worked the same as above, I used the longer version above in hopes it would count separately but alas
I've also tried =SUMPRODUCT((C:C>=1)+(D:D>=1)+(E:E>=1)) which also counts the cells, but of course adds the results together rather than count 1 per row.
I'm kinda hoping I've been incredibly silly with this, but after referencing several sources it seems I'm trying to use a 3D array which would naturally be more in depth than the above functions, I can provide real examples if it helps more.
Thank you all for your time!
Martin