Jan 29 2022 02:16 PM
trying to create a simple tracking document for new client referrals, working in Office 365
I used =COUNTA(UNIQUE(B2:B6)) to count the number of unique names across all years, which tells me the total number of new client referrals across all years
But I need to figure out a way to count new client referrals in a certain year (ideally selected from a drop down menu in G5 that I haven't created yet) ... it's very important that names that are counted in a certain year are unique ACROSS ALL YEARS
e.g. if you select for certain year, let's say 2022, to see count of new referrals .... John Smith is NOT a new referral despite his name showing up once uniquely in 2022 and should not be counted since he was already a client in 2021
e.g. if you select for year 2022, there is 1 unique new referral (Music, Maker)
e.g. if you select for year 2021, there is 3 unique new referrals (all 3 names, since no referrals occurred before 2021)
I also need a way to count new client referrals in a certain year AND a certain month from a future drop down in G6 if you can include that in a formula
e.g. if you select for year 2022 and month February, there is 0 unique new referrals (no referrals occurred in Feb 2022)
I've been trying with COUNTIF, UNIQUE, SUM, FREQUENCY, MATCH, YEAR, MONTH, IF for hours!! thanks
Jan 29 2022 03:05 PM
See the attached sample workbook. I used two helper columns (and I used the month number instead of the month name).
Jan 29 2022 04:02 PM
I am not sure that I have completely understood the requirement but, for me, the key formula would seem to be
= MINIFS(Date, Name, UNIQUE(Name))
giving the first referral date for each name. That can then be dressed up to provide annual new referral numbers or any specific monthly referral number
= LET(
distinctYears, UNIQUE(YEAR(Date)),
newReferral, UNIQUE(Name),
referralDate, MINIFS(Date, Name, newReferral),
referalYear, YEAR(referralDate),
MAP(distinctYears, LAMBDA(yr, SUM(N(referalYear=yr))))
)
and
= LET(
distinctYears, UNIQUE(YEAR(Date)),
newReferral, UNIQUE(Name),
referralDate, MINIFS(Date, Name, newReferral),
referralYear, YEAR(referralDate),
referralMonth, MONTH(referralDate),
SUM((referralMonth=selectedMonth)*(referralYear=selectedYear))
)
Jan 29 2022 05:36 PM
Jan 30 2022 12:29 AM
The functions I used should be available in Excel in Microsoft 365...
Jan 30 2022 06:58 AM
Jan 30 2022 06:59 AM
Jan 30 2022 07:07 AM - edited Jan 30 2022 07:08 AM
I have no idea what you mean. In the workbook that I attached the formula in D2 is
=(COUNTIFS($A$2:$A$43,"<"&DATE($H$5,1,1),$B$2:$B$43,B2)=0)*(YEAR(A2)=$H$5)
In E2:
=(COUNTIFS($A$2:$A$43,"<"&DATE($H$5,$H$6,1),$B$2:$B$43,B2)=0)*((YEAR(A2)=$H$5)*(MONTH(A2)=$H$6))
In I5:
=SUM(--(UNIQUE(IF(D2:D43,B2:B43,""))<>""))
The rest are the same, only with different cell references. Nothing with ARRAY in the name.
Are you sure that you have Microsoft 365?
Jan 30 2022 07:20 AM