the problem with yday’s code is that SWITCH there, (which switches between day/week/month when a user selects between day/week/month in the dropdown menu), w/o the dropdown menu it returns errors, I don’t know how to change that and b/c I’m on a free plan w/ chatgpt I can’t further ask it anything until 8pm my time, so in 3 half hrs. lol, if you know how to take this code:
=LET(
startDate,
SWITCH(B1,
“Daily”,TODAY(),
“Weekly”,TODAY()-WEEKDAY(TODAY(),2)+1,
“Monthly”,EOMONTH(TODAY(),-1)+1),
endDate,
SWITCH(B1,
“Daily”,TODAY()+1,
“Weekly”,TODAY()-WEEKDAY(TODAY(),2)+8,
“Monthly”,EOMONTH(TODAY(),0)+1),
leaders,
QUERY(
‘Focused BCs’!I:K,
“select I, count(I)
where I is not null
and K >= date '”&TEXT(startDate,“yyyy-MM-dd”)&"’
and K < date ‘"&TEXT(endDate,“yyyy-MM-dd”)&"’
group by I
order by count(I) desc",
0),
HSTACK(
ARRAYFORMULA(
IF(
SEQUENCE(ROWS(leaders))=1,“
”,
IF(
SEQUENCE(ROWS(leaders))=2,“
”,
IF(
SEQUENCE(ROWS(leaders))=3,“
”,
SEQUENCE(ROWS(leaders))
)))
),
leaders
)
)
and change it as needed so that SWITCH is not needed and day/ week/ month can go in their respective rows+ cells please do, otherwise we wait lol