问题
Please refer the below screenshot:
Assume that today's date is 29-4-2018 (dd-mm-yyyy). There are two users (User 1 and User 2). Both of them have worked in various Workspaces (Workspace1, Workspace 2 and Workspace 3) on different dates.
I want to calculate the number of jobs a user has done on today's date in various workspaces and then display the count in cell C2 and C3 respectively so that the result is something like this:
Any Idea how to write a formula to achieve this result?
P.S. I know I have to try it first, but I a complete newbie to excel and don't know much except for very basic formula. For this one, I don't even know where to start.
EDIT: Just in case if anyone wants to download this workbook
回答1:
Use the following formula in C2
cell
=COUNTIFS($B$8:$B$26,B2,$D$8:$D$26,"29-04-2018")+COUNTIFS($E$8:$E$26,B2,$G$8:$G$26,"29-04-2018")+COUNTIFS($H$8:$H$26,B2,$J$8:$J$26,"29-04-2018")
If it is actually today then you can replace 29-04-2018
with Today()
so, the formula will be
=COUNTIFS($B$8:$B$26,B2,$D$8:$D$26,TODAY())+COUNTIFS($E$8:$E$26,B2,$G$8:$G$26,TODAY())+COUNTIFS($H$8:$H$26,B2,$J$8:$J$26,TODAY())
Edited answer from Scott Craner comments
=COUNTIFS($B$8:$H$26,B2,$D$8:$J$26,TODAY())
来源:https://stackoverflow.com/questions/50086256/how-to-write-the-formula-to-make-this-happen-in-excel