Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Spreadsheet COUNTIF TODAY()?

Is there any way to COUNTIF it's the current date?

For example I have a spreadsheet with work orders, once the employee starts the work order it captures a time stamp, after the work order is completed it is moved to an archive, well I wanted to create a summary sheet that tells me how many orders we have done for that date, the format of the time stamp is:

2/19/2014 17:10:20

So basically I need a COUNTIF to count the column for the current date.

Is this possible?

like image 654
b3ck Avatar asked Feb 21 '14 10:02

b3ck


People also ask

What does the function today () do in Google Sheets?

TODAY provides the current date with no time component. To create a date with the current time, use NOW . TODAY will always represent the current date the last time the spreadsheet was recalculated, rather than remaining at the date when it was first entered.

Can you use the Countif function on dates?

To count numbers or dates that fall within a range (such as greater than 9000 and at the same time less than 22500), you can use the COUNTIFS function. Alternately, you can use SUMPRODUCT too.


2 Answers

The new version of Google Sheets has COUNTIFS, which would allow =COUNTIFS(A:A,">="&TODAY(),A:A,"<"&TODAY()+1)

You need to opt in to the new version to make it work, though. ("Try the new Google Sheets")

like image 158
maybeWeCouldStealAVan Avatar answered Nov 11 '22 06:11

maybeWeCouldStealAVan


You would need to apply a function first on the range, which then makes COUNTIF not an appropriate function to count those dates matching 'today'. You can use SUMPRODUCT instead:

=arrayformula(SUMPRODUCT(1*(INT(A1:A100)=TODAY())))

INT strips out the time from the datetime.

like image 23
Jerry Avatar answered Nov 11 '22 08:11

Jerry