I have a table where column A is the date/time, and column B fruits sold. I need a formula that automatically counts how many fruits were sold per day. With the following additional conditions:
- I need the present-day included.
- I need weekends excluded.
- I also need this formula to respond to a menu with the desired time period.
- Days with "0" count should not appear.
Here is a sample data:
Date | Fruit | Period |
---|---|---|
20/10/2022 | 18 | |
21/10/2022 | 15 | |
22/10/2022 | 10 | |
23/10/2022 | 4 | |
[...] | ||
27/11/2022 | 19 | |
28/11/2022 | 21 |
I have this formula (not mine tbf):
=LET(d,HubLog[Date],s,INT(MIN(d)),e,INT(MAX(d)),days,SEQUENCE(e-s,,s),
weekdays,FILTER(days,MOD(days,7)>1),qty,
COUNTIFS(HubLog[Date],">="&weekdays,HubLog[Date],"<"&weekdays+1),
CHOOSE({1,2},weekdays,qty))
But it does not seem to be working properly here. Also, in another file I have it was counting but not including the present day and not responsive to the time period menu. The file below is a simplified version of my real file, but for some reason it does not even seem to work.
Is there anything that can be changed in the formula to achieve the requirements explained above?
Dummy file: https://1drv.ms/x/s!AhJ6NsWJczYBhSjKQVMab8WlYINT?e=uxZOJs