Search code examples
worksheet-functioncountifexcel-2016

Can't get WORKDAY function to work with a COUNTIF


Trying to work on a system at work that will tell how many error codes were registered by a particular machine on the previous workday. This spreadsheet will need to be able to select only the errors generated on the previous date as this will become a rolling list of data generated across a wide time span. Currently working with the formula

=TODAY(),-1,B2:B17) 

where the last array is some shutdown days I've put in to generate a global variable "Yesterday" and trying to use the formula

=COUNTIF(Table1[DateOnly],"="&Yesterday) 

to gather the number of records that occurred yesterday.

Can anyone tell me where I'm going wrong?


Solution

  • Found that the issue was when I tried to convert the timestamp in mm/dd/yy hh:mm:ss format to mm/dd/yy and didn't realize that the other information was still hiding in there and confusing the formula. One of my coworkers recommended the use of a ROUNDDOWN function in the use of =ROUNDDOWN(argument,0) to get rid of the time information and just leave me with date.