So I'm currently making a recruiting data sheet for an online community. I'm trying to make it as automated as possible without actually making a bot to do it.
How can I make a COUNTIF
(or similar) that counts the amount of people join within a time period?
My current strategy was to do this:
=COUNTIF(D3:D900,"2/\**$/2020")
Its not getting the expected results, but I'm also not quite good with Regex in Google Sheets. This strategy is attempting to get a result for the amount of people who joined in the month of February using the dates.
Best Answer
You do not really need any regex function. You can use the different versions of the following formula instead.
Y
values within the second month (February)Have a look at the example I created in your sheet.
How the formula
=ARRAYFORMULA(COUNTIFS(V21:V38,"<>",MONTH(U21:U38), "="&2))
works:COUNTIFS
looks into the first rangeU21:V21
and in cellV21
it calculates the value according to the criterion"<>"
which means not empty.It then goes to the next cell
U21
where the functionMONTH
has already extracted the month from cell that in our case is different from the second criterion2
and in this caseCOUNTIFS
drops the value.Then
ARRAYFORMULA
takes over and repeats the process in the next row and keeps on doing that till it hits the end of our range on row 38.The final result is 6, which means only 6 pairs met both the criteria.
Functions used: