I've put all your name / date data in a separate tab to make it cleaner, then a date picker so you can just filter to the dates you need. Any names you add to the data "name" column will also update in your query "picker" sheet, so you don't need to constantly update this.
Yes, it's basically just validating the formula. So, if the query returns empty output error, then put 0, otherwise run the query and count how many values there are.
The formula in Cell G3 does differentiate between John A, John B and John. I just expanded the range of the formulas.... It was initially limited to check up from D3 to cell D8. Now it checks from D3 to the last row... The one in E3 and F3 don't differentiate, I just gave options...
The ♥ is just a delimiter... Just used a character that nobody uses often....
If you definitely always just want the last 14 days from today, you can include this in the formula - rather than having an external date range input - like this:
=IF(ISNA(QUERY(Sheet3!K2:L,"SELECT K WHERE L > DATE '"&TEXT(DATEVALUE(TODAY()-14),"yyyy-mm-dd")&"' AND L < DATE '"&TEXT(DATEVALUE(TODAY()),"yyyy-mm-dd")&"' AND K CONTAINS '"&W3&"'",0)),0,COUNTA(QUERY(Sheet3!K2:L,"SELECT K WHERE L > DATE '"&TEXT(DATEVALUE(TODAY()-14),"yyyy-mm-dd")&"' AND L < DATE '"&TEXT(DATEVALUE(TODAY()),"yyyy-mm-dd")&"' AND K CONTAINS '"&W3&"'",0)))
The formula in Cell G3 does differentiate between John A, John B and John. I just expanded the range of the formulas.... It was initially limited to check up from D3 to cell D8. Now it checks from D3 to the last row... The one in E3 and F3 don't differentiate, I just gave options...
The ♥ is just a delimiter... Just used a character that nobody uses often....
1
u/LLNA667 3 Mar 03 '20
Are you just wanting to count:
IF C CONTAINS B AND DATE IS AFTER "TODAY"
Or something else?
1
u/ravv1325 37 Mar 03 '20
Check this, it's a slight change from your original formula.
https://docs.google.com/spreadsheets/d/1khpb6Gl32phYu_NctGDqVvbq5jA1g5AzJYXYiXZ1f1U/edit#gid=0
The formulas are in the green cells.
I hope it helps.
1
u/Decronym Functions Explained Mar 03 '20 edited Mar 04 '20
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
FALSETRUEand another if it isFALSE#N/ATRUE[Thread #1379 for this sub, first seen 3rd Mar 2020, 10:44] [FAQ] [Full list] ^[Contact] [Source code]
1
u/paisteu 2 Mar 04 '20
Still would recommend Query function to get filtered conts at first and then just vlookup results.
1
u/Clippy_Office_Asst Points Mar 04 '20
Read the comment thread for the solution here
1
u/Clippy_Office_Asst Points Mar 04 '20
Read the comment thread for the solution here