I'm having issues with getting the result using my code from different sheet.
Here is my project:
Date | Agent | Status |
---|---|---|
02/01/2025 | Rey | Valid |
01/01/2025 | Rey | Invalid |
03/02/2025 | Paul | Valid |
04/03/2025 | Rey | Valid |
01/04/2025 | Paul | Valid |
I'm having issues with getting the result using my code from different sheet.
Here is my project:
Date | Agent | Status |
---|---|---|
02/01/2025 | Rey | Valid |
01/01/2025 | Rey | Invalid |
03/02/2025 | Paul | Valid |
04/03/2025 | Rey | Valid |
01/04/2025 | Paul | Valid |
Sheet 2:
Name : | Rey |
---|---|
Number of Total Calls | 3 |
Number of Invalid Calls | 2 |
Number of Valid Calls | 1 |
Here is my code:
=COUNTIFS(VLOOKUP(D4(FILTER(Sheet1!A:A, Sheet1!B:B="Rey", Sheet1!C:C="Invalid"),">=01/01/2025", FILTER((Sheet1!A:A, Sheet1!B:B="Rey", Sheet1!C:C="Invalid"),"<=01/31/2025"), TRUE)))
Share
Improve this question
edited Mar 18 at 20:04
Reynaldo Gravador
asked Mar 18 at 19:07
Reynaldo GravadorReynaldo Gravador
214 bronze badges
3
- I think you've interchanged the outputs for the Number of Invalid Calls and the Number of Valid Calls. From what I see, there's only 1 invalid call with 2 valid calls. – Saddles Commented Mar 18 at 20:10
- Result that I have is error – Reynaldo Gravador Commented Mar 18 at 20:31
- Result that I have is error — this seems to be directed to @Gyul. Their answer is working, so it's likely that you just need to fix where the formula is pointed to. – Saddles Commented Mar 18 at 20:44
1 Answer
Reset to default 1Use the COUNTIF/S with the LET and VSTACK functions
I used the COUNTIF/S function to return the count based on a criteria. I also used the LET function to combine the formulas into one and then stack it vertically using VSTACK.
Below is the formula:
=LET(a, COUNTIF(Sheet1!B1:B, "Rey"),
b, COUNTIFS(Sheet1!B1:B, "Rey", Sheet1!C1:C, "Invalid"),
c, COUNTIFS(Sheet1!B1:B, "Rey", Sheet1!C1:C, "Valid"),
VSTACK(a, b, c))
Output:
Name : | Rey |
---|---|
Number of Total Calls | 3 |
Number of Invalid Calls | 1 |
Number of Valid Calls | 2 |
References
- COUNTIFS
- VSTACK
- LET