Counting within a formula

BlahQz

New Member
Joined
Nov 2, 2024
Messages
8
Office Version
  1. 365
Platform
  1. Windows
I have a block of data with 2 columns. One for names, and another for dates. In the Names column, there are 5 unique names but have multiple entries (User1 - User5) and beside each is a corresponding date.

What I've done so far is create a formula in cell E19 that will show the unique names in the list that have dates 3 days ago (excluding weekends). For example today is Dec 9th, so 3 days ago (including today's date) is actually Dec 5th. My goal is to have a formula that shows the unique name as well as the number of times it fits the criteria of the formula I made.

Apologies for having to upload a screenshot, the Xl2bb addin didn't work for me maybe due to restrictions on my machine, not sure.

Formula in cell E19:

=TEXTJOIN(", ",TRUE,(SORT(UNIQUE(IF(INT(B2:B16)<=WORKDAY.INTL(TODAY(),-2,"0000011"),A2:A16,"")))))

1733785394927.png


*The answers part in the screenshot is just for reference
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
try

Excel Formula:
=IFERROR(LET(names,A2:B16,dates,B2:B16,crrntday,TODAY()-4,
data,FILTER(names,INT(dates)<crrntday),
TEXTJOIN(", ",,CONCATENATE(UNIQUE(CHOOSECOLS(data,1))," ("&SCAN(0,UNIQUE(CHOOSECOLS(data,1)),LAMBDA(a,b,SUM(--(b=CHOOSECOLS(data,1)))))&")"))),"No Day")

** U Can change 'crrntday' with any day


1733796019581.png
 
Upvote 0
Solution
Another option
Excel Formula:
=LET(g,GROUPBY(A2:A16,B2:B16,COUNT,0,0,,INT(B2:B16)<=WORKDAY(TODAY(),-2)),t,TEXTJOIN({" (","),"},0,FILTER(g,INDEX(g,,2)>0),""),LEFT(t,LEN(t)-1))
 
Upvote 0
try

Excel Formula:
=IFERROR(LET(names,A2:B16,dates,B2:B16,crrntday,TODAY()-4,
data,FILTER(names,INT(dates)<crrntday),
TEXTJOIN(", ",,CONCATENATE(UNIQUE(CHOOSECOLS(data,1))," ("&SCAN(0,UNIQUE(CHOOSECOLS(data,1)),LAMBDA(a,b,SUM(--(b=CHOOSECOLS(data,1)))))&")"))),"No Day")

** U Can change 'crrntday' with any day


View attachment 120208
This one worked best for me I really appreciate it SunnyAlv
 
Upvote 0
Another option
Excel Formula:
=LET(g,GROUPBY(A2:A16,B2:B16,COUNT,0,0,,INT(B2:B16)<=WORKDAY(TODAY(),-2)),t,TEXTJOIN({" (","),"},0,FILTER(g,INDEX(g,,2)>0),""),LEFT(t,LEN(t)-1))
This one unfortunately didn't work for me, gave a #Name error. It is ok however I got the answer I needed on this one. I appreciate your time on this as well Fluff :)
 
Upvote 0
Sounds like you don't have GROUPBY yet.
 
Upvote 0
Sounds like you don't have GROUPBY yet.
No I guess not. I still appreciate the help though. Still amazes me how good you all are at this stuff. Something to aspire to. :)
 
Upvote 0

Forum statistics

Threads
1,225,381
Messages
6,184,631
Members
453,248
Latest member
gmazee

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