What I’m aiming for is a way to count specific project types from yesterday only. My project codes are text (like 25A, 25B, 25C) and dates are in the format 6/3/2014 16:41:36.
Any ideas on how to combine these or create a new formula that does both? Thanks!
I’ve wrestled with similar spreadsheet challenges before, and I think I’ve got a solution that might work for you:
=QUERY(‘V1 Archive’!C:M, “SELECT COUNT(D) WHERE D = ‘25A’ AND DATE(M) = DATE '” & TEXT(TODAY()-1, “yyyy-mm-dd”) & “'”, 0)
This QUERY function does a couple of things: it filters for your specific project type (25A in this case) and checks for yesterday’s date. The beauty of this approach is its flexibility; you can easily change the project type or adjust the date range. Plus, it’s generally faster than array formulas when dealing with large datasets.
Just make sure your date column (M) is formatted as dates. If they’re text, you might need to wrap the M column reference in DATEVALUE().
This formula combines the date check and project type filter. It evaluates each row, checking if the date in column M is yesterday and if the project code in column D matches “25A”. The result is a count of matching entries.
You can easily modify the project code or date criteria as needed. For instance, to count projects from the last 7 days, replace TODAY()-1 with TODAY()-7.