Forum Discussion
terri2751
Jan 11, 2023Copper Contributor
Calculating by. Date and columns
I have a worksheet which has a column “Reason For Visit” which has various descriptors within each cell. I.e. “food”, “lawyer”,”socializing”. There is another column with dates. I want to calculat...
mathetes
Jan 11, 2023Silver Contributor
Putting dates in column A, reasons in column B, I've come up with two formulas that work. I extended columns A and B down to row 41, just to give the formulas something to work with.
The first formula requires a newer version of Excel than you have, in order for the FILTER function to work.
=COUNTA(FILTER(B2:B41,(B2:B41=E2)*(A2:A41>=F2)*(A2:A41<=G2)))
The syntax of the second is tricky, but it does work. I had to refer to this site to get it right (those quote marks around the <= and >= in setting the date parameters)
=COUNTIFS(B2:B41,E2,A2:A41,">="&F2,A2:A41,"<="&G2)