Formulas to count including Unique Numbers

Graham C1600

Board Regular
Joined
Feb 17, 2018
Messages
60
Hi M,

Thanks again for correcting me. Yes yo are correct. It would be 6 because as you say Brian should have been counted.
 

Graham C1600

Board Regular
Joined
Feb 17, 2018
Messages
60
Hi M,

This formula works when I do it small scale on the test data I use. When I try to expand it out onto the real data I just get an N/A in the cell. The formula I'm trying to use is as follows :-

=SUM(IF(FREQUENCY(IF(ISNA(MATCH(A2:A500,IF((I2:I500<>"")+(K2:K500="Yes"),A2:A500),0)),MATCH(A2:A500,A2:A500,0)),ROW(A2:A500)-ROW(A2)+1),1)) - followed by Ctrl/Shift & enter.

Any ideas on my mistake ?

Thanks
 

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
16,317
Hi M,

Thanks again for correcting me. Yes yo are correct. It would be 6 because as you say Brian should have been counted.

When I tested the formula I saw that I was wrong, too ;)
Actually the answer should be 7 - Andrew should be counted as well.

Try
=SUM(IF(D2:D14="No",--ISNUMBER(MATCH(A2:A14,IF((C2:C14<>"")*(D2:D14="No"),A2:A14),0))))
Ctrl+Shift+Enter

M.
 
Last edited:

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
16,317
Hi M,

This formula works when I do it small scale on the test data I use. When I try to expand it out onto the real data I just get an N/A in the cell. The formula I'm trying to use is as follows :-

=SUM(IF(FREQUENCY(IF(ISNA(MATCH(A2:A500,IF((I2:I500<>"")+(K2:K500="Yes"),A2:A500),0)),MATCH(A2:A500,A2:A500,0)),ROW(A2:A500)-ROW(A2)+1),1)) - followed by Ctrl/Shift & enter.

Any ideas on my mistake ?

Thanks
What query are you referring to? Are there blank cells in A2:A500? Or cells with errors?

M.
 

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
16,317
See if this works

=SUM(IF(FREQUENCY(IF(A2:A500<>"",IF(ISNA(MATCH(A2:A500,IF((I2:I500<>"")+(K2:K500="Yes"),A2:A500),0)),MATCH(A2:A500,A2:A500,0))),ROW(A2:A500)-ROW(A2)+1),1))
Ctrl+Shift+Enter

M.
 

Graham C1600

Board Regular
Joined
Feb 17, 2018
Messages
60
Thanks M.

4
th
query. I need to count the total amount of User ID’s where at least 1 person has data in their Last Logon box and the UTC =”No”.

This one now. The answer should be 5.

Everything else is working so thanks.
 

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
16,317
Shouldn't the result be 7?
ID1 = 3; ID5 = 1; ID7 = 1; ID8 = 2 (3+1+1+2=7)

M.
 

Graham C1600

Board Regular
Joined
Feb 17, 2018
Messages
60
Thanks M.

4
th
query. I need to count the total amount of User ID’s where at least 1 person has data in their Last Logon box and the UTC =”No”.

This one now. The answer should be 5.

Everything else is working so thanks.
Hi M,

Bad wording from me.

I need to count the total amount of User ID’s where there is data in their Last Logon box and the UTC =”No”.

Gary
Stephen
Simon
Darren
John
Thanks

<colgroup><col></colgroup><tbody>
</tbody>

<colgroup><col></colgroup><tbody>
</tbody>
<strike></strike>
 

Graham C1600

Board Regular
Joined
Feb 17, 2018
Messages
60
Thanks M works fine.

Next puzzle.

[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]I need to count the total amount of User ID’s where there is no data in the Last Logon Field and the UTC=”No”. This count needs to be similar to the 2nd query (=SUM(IF(FREQUENCY(IF(ISNA(MATCH(A2:A14,IF((C2:C14<>"")+(D2:D14="Yes"),A2:A14),0)),MATCH(A2:A14,A2:A14,0)),ROW(A2:A14)-ROW(A2)+1),1))) in that if there is a User ID that meets this requirement and another person with the same User ID does not meet the requirement then we need to disregard these users. So in this query the answer would be 2. which would be Steve & Rich. We cannot count Brian as both Gary & Stephen have logged in and they have the same user ID. Hope this makes sense.[/FONT]
 

Forum statistics

Threads
1,082,333
Messages
5,364,675
Members
400,810
Latest member
elbashka

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top