How can I rewrite this Excel formula so it properly excludes users with @mydomain.com in their email address? The formula currently counts all unique logins. The formula needs to accommodate blank records between rows 2 and 100,000.
Data sheet name "Data-User":
Column A is the activity type
Column C contains the date
Column M contains the user's email address
Column O contains the username
In another sheet (the report):
B6 is the cell containing the start date of the report
C6 is the cell containing the end date of the report
=SUM(IF(FREQUENCY(
IF(('Data-User'!A2:A100000="ACTIVITY_LOGIN_USER")*
('Data-User'!C2:C100000>=B6)*('Data-User'!C2:C100000<=C6)*
('Data-User'!O2:O100000<>"admin")*
('Data-User'!M2:M100000<>"*@mydomain.com")>0,
MATCH('Data-User'!M2:M100000,'Data-User'!M2:M100000,0),""),
IF(('Data-User'!A2:A100000="ACTIVITY_LOGIN_USER")*
('Data-User'!C2:C100000>=B6)*('Data-User'!C2:C100000<=C6)*
('Data-User'!O2:O100000<>"admin")*
('Data-User'!M2:M100000<>"*@mydomain.com")>0,
MATCH('Data-User'!M2:M100000,'Data-User'!M2:M100000,0),"")
)>0,1))