We need to count how many Mondays, Tuesdays etc. on a specific month have a specific letter at the next column. e.g How many Sundays of March 2024 have the letter “π” in the column B? (The result should be 1)
So far, the following formula does not take in consideration column B and is also inefficient.
The formula at A2 of the second sheet is:
=SUMPRODUCT(
Ωράριο.$A:$A>=DATE(LEFT($A2;4);RIGHT($A2;2);1);
Ωράριο.$A:$A<=DATE(LEFT($A2;4);RIGHT($A2;2);31);
TEXT(Ωράριο.$A:$A;"ddd")=B$1
)
This calculation produces the correct result and takes about 30 seconds.
Copying the formula to the adjacent 6 cells produces correct results and calculation is very slow taking about 3 minutes.
This is the first sheet and is called “Ωράριο”. Column A contains dates and column B contains text:
This is the second sheet and is using data from the first sheet: