Formula to count non duplicated numbers with relative columns criteria

Valderio

New Member
Joined
Jul 1, 2016
Messages
9
Hello all,

I ll try to be concise;

I have 2 sheets; one sheet have a table named BDc; this table have 3 fields [Nº], [Data da consulta], [Genótipo]; [Nº] have ID numbers of patients (there are duplicated ones); [Data da consulta] have dates of apointments; [Genótipo] have genotipic classes like "1a", "1b", "2a", etc...

In the other sheet i have report with some data, like how many patients come between some dates, etc. (start date of range is in B1 cell and end date in C1).

So what i want is a formula that i can count non duplicate patients ID, that come between dates range, with genotipic 1 (so count 1a + 1b), 2, 3, 4, etc

I start do this, but it doesn't work
=SUMPRODUCT(((BDc[Data da consulta]>=B1)*(BDc[Data da consulta]<=C1)*(BDc[Genótipo]="*1*"))/(COUNTIFS(BDc[Nº];BDc[Nº]; BDc[Data da consulta];">="&B1;BDc[Data da consulta];"<="&C1)+((BDc[Data da consulta]<=B1)+(BDc[Data da consulta]>=C1))))

I think is because "*1*", cause if i use "1a", the result is correct, but i really need the contain "**" and not a specific value

Does anyone can help??

Thx
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Control+shift+enter, not just enter:

=SUM(IF(FREQUENCY(IF((BDc[Nº]<>"")*(BDc[Data da consulta]>=B1)*(BDc[Data da consulta]<=C1)*ISNUMBER(SEARCH(1;BDc[Genótipo]));MATCH(BDc[Nº];BDc[Nº];0));ROW(BDc[Nº])-ROW(INDEX(BDc[Nº];1;1))+1);1))
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top