My master data sheet is named MASTER.
In my sheet named PRINT I want to be able to use a date picker, or somehow be prompted for a date, and then a Query pulls data from Master where date selected matches dates in MASTER column B. I have tried the following Query statement but it will only work if I change both sheets Date columns to TEXT format. I need to keep my date formats as is. If all that makes sense, I would really appreciate some help. My end goal is I just want a huge list of fabrication jobs, listed by date, to be queried and pulled to another sheet for printing. Leaving all Master data in tact and where the PRINT sheet can simply have a date change done by any user and get the list they need.
=Query(MASTER!A:P,ʺselect * where B ='ʺ&A2&ʺ'ʺ,0)
The above Query is on my TEST sheet where I have a date picker in column A2
Try:
=Query(MASTER!A:P,"select * where B =date"""&text(A2, "yyyy-mm-dd")&""" ",0)
and see if that works for you ?
Related
I have a cell with today’s date "like cell j11", and I have a "table shifts employee" that contains the numbered beginning of the month to its end, and the table contains data. I want to design a dashboard. If today’s date is equal to the date in the table, it shows me the name of the employees at the time of shift and the data written for the day. I need the formula.
You can combine the =today() function with a =vlookup() against your table to return the correct row of what you are looking for. The formulas are displayed in the image under the relevant cells.
In this example it finds todays date, and looks up the relevant date in the table, and returns the data you want to see into F5 and G5.
I have the spreadsheet attached.
I'd like to find Client No from lookup sheet based on the date provided in the live sheet.
The same client can appear with a different client number, so i need to lookup the name and date (from live sheet) and find the corresponding client number in the lookup sheet where the date from live sheet falls between the 2 dates on the lookup sheet.
I hope this makes sense.
Any help appreciated.
Thank you
This might do what you're looking for.
=IFERROR(
QUERY(SORT(FILTER(Lookup!A$2:D,Lookup!C$2:C=B2,Lookup!A$2:A<=A2),1,0),
"SELECT * WHERE COL4 >= DATE '"&TEXT(A2,"YYYY-MM-DD")&"' LIMIT 1",0),
QUERY(SORT(FILTER(Lookup!A$2:D,Lookup!C$2:C=B2,Lookup!A$2:A<=A2),1,0),
"SELECT * LIMIT 1",0) )
I've added a tab Live-GK to your sheet, with this formula in C2. It has to be dragged down. There may be another approach where it can be done as an arrayformula, but I haven't figured that out.
Note that on my tab, I'm doing the lookups from Lookup-GK, since I could add more test data there. The above formula can be used as is, pasted into cell C2 in your Live tab.
Note that for debugging purposes, column H of my tab returns all of the columns, not just the client #, so the start and end dates can be verified.
Let me know if this helps you.
Explanation:
The inner filter selects all rows from the Lookup tab where:
i) the client name (column C in Lookup) matches the client name in column B (of Live), and,
ii) the start date (column A in Lookup) is less than or equal the client date in Live.
These records are sorted in descending date order.
Then the query selects the first record where the end date (column D in Lookup) is greater than the client date in Live.
If the Lookup record has no end date, this gives an error (empty query result) so IFERROR, a second query is run, but without the filtering by end date, selecting the one record with no end date, but an appropriate start date.
These seemed to work with the few test records I used. If there is a duplication of client dates, the first client # is returned. See client #1 and #7 in my test data. Some more error handling might be necessary if your client records might have overlapping date ranges, as CalculusWhiz asked.
I have been working on how I budget and keep track of my finances. In the process, I put together this Google Sheet which I am happy to share a dummy version of (includes dummy data).
I use a Google Form to input new entries which are recorded in the 'Log' page.
From here, I use a few SUMIFS to pull in the totals of any given income/expense category based on the category name (referenced in the cell adjacent), the month (B3), and the year (C3).
What I now want to do is add a table (currently in columns O:Q) that calls in itemised log records based on the category selected (O2) and the month and the year. On the reference sheet these are cells (B3) and (C3) respectively and in the log, these are columns (F) and (G).
I've gotten as far as using an INDEX / SMALL array formula combination to pull in all spending as per the category selected in (O2), but what I cannot seem to figure out is how to then restrict results to only those that also match the month and year. I've tried using a MATCH formula but am unsure how to append this within the current formula string, if it is even possible?
Once working, this would (for example) mean that only rows 4 and 5 in columns O, P, and Q would be populated as these are the records for the selected month, June 2016.
Is what I want to do possible through a more complex formula? Can anybody help?
Thank you in advance.
Link to my Google Sheet: https://docs.google.com/spreadsheets/d/1_GGgFCfMtB5ROkTmpx4Fn4nZZbBIvBa4vpOwqswH5E0/edit?usp=sharing
The following should do the trick.
Delete everything in O4:Q14
In cell O4, write: =FILTER(Log!H2:H, Log!B2:B=O$2, Log!G2:G=C$3, Log!F2:F=B$3)
In cell P4, write: =FILTER(Log!E2:E, Log!B2:B=O$2, Log!G2:G=C$3, Log!F2:F=B$3)
In cell Q4, write: =FILTER(Log!D2:D, Log!B2:B=O$2, Log!G2:G=C$3, Log!F2:F=B$3)
(By the way, you can generate columns F, G and maybe E from column A in the Logs sheet. For example, just remove the data that is already in column G and in G2 write: =ARRAYFORMULA(YEAR(A2:A))
Link to spreadsheet with fixes:
https://docs.google.com/spreadsheets/d/1iIplXRa28L7FdmqI91RbjApO3g-GU5uk6rTQLqi7vFw/edit#gid=0
I have two sheets, Progress and App1stSession, in the same spreadsheet.
Progress sheet has these columns
Date Campaign Sessions 1stSessions
App1stSession sheet these columns
Date Campaign 1stSessions
I need to retrieve 1stSessions values from App1stSession. The match can be done on Date and Campaign values.
I've written this formula
INDEX(App1stSession!$A$1:C,
AND(MATCH($B1,App1stSession!$B$1:B,0),MATCH($A1,App1stSession!$A$1:A,0))),3)
Of course it doesn't work because AND retrieves 0 or 1.
So I've tried this solution
INDEX(App1stSession!$A$1:C,IF(AND(MATCH($B1,App1stSession!$B$1:C,0),MATCH($A1
,App1stSession!$A$1:A,0)),MATCH($C1,App1stSession!$C$1:C,0)),3)
I suppose that the second MATCH could retrieve the right row: neither this solution works.
Finally I've tried
=QUERY(App1stSession!$A$1:A,"SELECT """&App1stSession!$C1:C&""" WHERE
("""&App1stSession!$A$1:A&"""="""&$A1&""")AND("""&App1stSession!$B$1:B&"""="""&$C1&""")")
Again it doesn't work but I suppose because of a matter of syntax.
Any suggestion ?
Thanks
The way I would do it, is insert one unique id column/search key in column A, before the rest of your data, that is dynamically created by the date & campaign values in your App1stSession sheet:
=B1&C1
then use this type of formula to smush the same two values together dynamically on your search sheet in a vlookup fashion on your progress sheet:
=VLOOKUP(A1&B1,App1stSession!A:D,4,false)
I have a google spreadsheet with 2 sheets. The first sheet contains data that has been input by a form. Each form response will input data for the following "Timestamp", "Zone", "NPC", "Faction", "Amount", "Faction2", "Amount2", "Faction3", "Amount3", "Faction4", "Amount4", "Faction5", "Amount5".
Row 1 contains the above category names for each response input. The way the form works unfortunately is that each response is put into it's own column based on what Zone is chosen at the beginning as each Zone has different possible responses for the category. So the data is spread out from Columns C to Columns HC. Each row will only have one response per category name, but the category names are repeated and spread out.
I have been using the following query in Sheet2 to pull the information from whichever "Zone" that is selected from the E1 dropdown in the sheet.
=if(len(E1)=0,"Please Select a Zone in E1",query('Form Responses'!A2:IS,"Select * Where B = """&E1&""" "))
The problem is that it returns the entire Row for the Selected zone so the following information doesn't line up. Is there any way for me to return only the information from the Rows that have data in the cell. This would then line up the data into the correct Column for Sheet2
Below is a link to the Form with some sample data in it, the Cobalt Scar selection lines up as the responses are in the corresponding columns in the data sheet, but Crystal Caverns and Western Wastes do not. You can change selected zone to view the results in Sheet2 E1.
Also the sheet is a copy and can be edited by the public.
https://docs.google.com/spreadsheet/ccc?key=0AqEFpZnTydP-dFNNOV9sRzNRSldDUXRJX1pqSFZRYkE&usp=sharing
I haven't found an elegant solution to this type of problem, but that doesn't mean it's not solvable.
The solution I created on your sheets is easily manageable (only have to update the sheet with the area / column table), but it does take up a little more memory.
How it works:
The ArrangedData tab is the first 2 columns from Form Responses, then the "appropriate" columns (based on the selection made on sheet2; it picks the columns from a lookup on sheet5).
Then ArrangedData is filtered (based on the selection on sheet2 again) into sheet2.
Let me know if you have any questions about it.