FILTER Range with Multiple Conditions - Skip Blank Cells in Google Sheets - google-sheets

Building a dynamic schedule dashboard in Google Sheets.
Limited to using only functions and formulas, no scripts.
Have a living table (range A1:M) where each row represents a different event.
I need to pull multiple rows of data (all text strings) and populate into single column.
Some columns may be empty (ie. not all events have an Agenda or a Group associated with them).
Query and some other functions don't work because they won't pull the hyperlinks.
The below function works, but I cannot figure out how to get it to skip the blank cells.
=FLATTEN(FILTER($F$2:$M, $B$2:$B=$O$2, $D$2:$D=$Q$2, $E$2:$E=$P$2))
It would be great to add a blank column at the end though that is NOT skipped, so when it returns each row of event details into a column, there is a space between each event.
Here is an example of the table:
Calendar
Event Type
Cadence
Day
Title
Descrip.
Agenda
Group
POC
Team A
Optional
Weekly
Monday
Co. Q&A
Info.
hyperlink
website
John
Team B
Mandatory
Bi-Weekly
Tuesday
Team mtg.
Info.
blank
website
Amy
Team C
Mandatory
Weekly
Monday
Mgr. Sync
Info.
hyperlink
blank
Chris
Tried IF statements with ISBLANK as well as <>"" but I am not sure if I am putting those in the right place.
The formula below is another variation, which works to populate a separate sheet, but it also does NOT skip blanks and is only pulling the first instance found.
=iferror(VLOOKUP(CONCATENATE($D$3,$C$8,D$7), DataC!$A$1:$M$160,MATCH($A$11,DataC!$A$1:$M$1,0),0),"")

you could try wrapping your working formula within QUERY()
=QUERY(FLATTEN(FILTER($F$2:$M, $B$2:$B=$O$2, $D$2:$D=$Q$2, $E$2:$E=$P$2)),"Select * Where Col1!=''")

Related

How do I pull the first instance of an open orders expected receive date into a different Google sheet, comparing parts lists

I'm working on an inventory system in Google Sheets and I need to pull data from one sheet into another sheet within the same work book.
I have two lists of parts, one is an indented BOM, that shows quantity of parts. The other is a Purchasing/Receiving log for inventory.
I need to compare the BOM with the Purchasing sheet to find the first instance of an order for that part, then check if it is still open or not, then pull the expected delivery date into the matching row in the BOM sheet assuming that order is still open.
These are the two formula I have that are the closest.
=IF(ISBLANK(A2),"",(SUMIF('PURCHASING/RECEIVING LOG'!D:D,B:B,'PURCHASING/RECEIVING LOG'!L:L)))
This one SUMS the date value, resulting in way off dates when converted back into a date format, but it correctly lines up all dates from PURCHASING RECEIVING, that match part name in BOM
=IF(B:B='PURCHASING/RECEIVING LOG'!D:D,IF('PURCHASING/RECEIVING LOG'!C:C="OPEN",'PURCHASING/RECEIVING LOG'!L:L,"WRONG"),"WRONG2")
This one correctly checks if the purchase order is open or not, but it only pulls the date if the rows match, instead of matching up the data for both columns. So if 'BOM'!B2 = 'PURCHASING RECEIVING'!D2. I need to check if any row in 'PURCHASING RECEIVING'!D:D = 'BOM'!B2, then B3 then B4 etc. Then pull the relevant information from 'PURCHASING RECEIVING'!L:L
Neither of them pull only the first instance of a matching open order.
There are duplicate parts in both the BOM and the Purchasing sheet, since multiple machines use the same parts, and we have multiple open orders for the same parts at any given time.
Any help or if someone could point me in the right direction would be greatly appreciated.
Please let me know if there are any questions.
Thank you.
EDIT: Added sample sheet
https://docs.google.com/spreadsheets/d/1fsrl4h__GbtHeHUCBs0PS25HR8MhWEplQ2bY-qcdWlw/edit?usp=sharing
You can use a QUERY on the second sheet to pull the required date, for example in cell G3, you would use:
=QUERY('PURCHASING RECEIVING'!$B$2:$E,"select min(E) where B = 'OPEN' and C ='"&E3&"' label min(E) ''")
And then drag down to the rest of the rows.
Sample Output:
Reference:
QUERY function
Query Language Reference

Formula for looking up and filtering data from a sheet

I want to do a complex formula using google sheets:
I have a list of place that will be visited by different people.
Some places are not to be visited, marked with /
Some places need to be assigned, marked with ?
Wanted outcome:
A list of cells that changes every day automatic.
An overview of who is going where that day and what needs to be assigned.
So I need a formula that can select a row based on today() and then filter out Persons in that row. Then for each person, another formula that looks up the first row in the table and puts duplicates together.
Example:
Wanted outcome:
Link to excel file, but it needs to work in google sheets too: xlsx
My solution is not the most elegant but it does the job.
First I build a column with date and unique persons or ? in this column:
=unique(sort(transpose(index(A1:H10,match(today(),A1:A10,0)))))
Then I find Places corresponding to these persons (I use filter function for it and then I use textjoin to keep them in single cell).
The formula is copied down as filter function does not accept a range and arrayformula as a filtering criterium.
My solution is available here:
https://docs.google.com/spreadsheets/d/1GTy_UaFP8LbA8OLnEhT_R_twpDCIWCuvQfBAigqtbR0/copy

Formula (Array, etc.) for automatic Google Sheets Indexing using inputs from Google Forms

I'm hoping that someone can help me tweak (or even substitute) a formula that I'm using in Google Sheets to automatically populate columns with information based on inputs from a Google form.
Simply put, I am using the Index function to match the name that is selected from a drop-down menu in the Google Form and arrives in Column E of the Google Sheet receiving the responses with an identical list of names in Column A of 'Sheet 2'. The index formula takes information from 'Sheet 2' relating to that name (e.g. Registration Number, Email Address) and places it in the 'Formresponses 1'sheet alongside the inputs from the Google form (including, of course, the name that appears in Column E'.
I have been using (variations on) the following formula without any issues, but I have to manually drag it down the relevant column in 'Formresponses 1' each time a new entry/name arrives from the Google Form: =index(Sheet2!$B$2:$B,match(E2, Sheet2!$A$2:$A,0),1)
I have successfully used Array Formulas to automatically carry out other functions on data arriving from a Google Form (i.e. adding up individual numbers to arrive at an overall total), but in this case I cannot figure out how to create a formula that will automatically take each new name that arrives in column E and insert it into the relevant indexing formula at that end of that new row.
Any suggestions - or solutions! - would be greatly welcome!
Thanks,
A.
Cheers I'-'I,
I've used I'-'I's response to my original question here as a starting point and, with a bit of research, I've come up with the following working formula:
= ArrayFormula(vlookup(E2:E, Sheet2!A:E, {1,2,3,5},FALSE))
[The curly brackets simply indicate the columns in Sheet 2 from which I want to pull pieces of data relating to each name that is matched up in the 'front end' sheet receiving the responses from the Google Form.] As with my previous problems with array formulas, I found the following website really useful, so full credit has to go to it: benlcollins.com

Google Sheets Formula for Pulling Specific Values in Two Ways

I'm trying to do a couple of different things with a spreadsheet in Google and running into some problems with the formulas I am using. I'm hoping someone might be able to direct me to a better solution or be able to correct the current issue I'm having.
First off all, here is a view of the data on Sheet 1 that I am pulling from:
Example Spreadsheet
The first task I'm trying to accomplish is to create a sheet that lists all of these shift days with the date in one column and the subject ("P: Ben" or S: Nicole") in another column. This sheet would be used to import the data via a CSV into our calendar system each month. I tried doing an Index-Match where it used the date to pull the associated values however I found that I had to keep adjusting the formula offsets in order to capture new information. It doesn't seem like Index-Match works when multiple rows/columns are involved. Is there a better way to pull this information?
The second task I am trying to accomplish is to create a new tab which lists all the dates a specific person is assigned too (that way this tab will update in real time and everyone can just look at their own sheet to see what days they are on-call). However, I run into the same problem here because for each new row I have to change the formula to reflect the correct information otherwise it doesn't pull the correct cell when it finds a match.
I would appreciate any and all information/advice on how to accomplish these tasks with the formula combination I mentioned or suggestions on other formulas to use that I have not been able to find.
Thanks in advance!
Brandon. There are a few ways to attack your tasks, but looking at the structure of your data, I would use curly brackets {} to create arrays. Here is an excerpt of how Google explains arrays in Sheets:
You can also create your own arrays in a formula in your spreadsheet
by using brackets { }. The brackets allow you to group together
values, while you use the following punctuation to determine which
order the values are displayed in:
Commas: Separate columns to help you write a row of data in an array.
For example, ={1, 2} would place the number 1 in the first cell and
the number 2 in the cell to the right in a new column.
Semicolons: Separate rows to help you write a column of data in an array. For
example, ={1; 2} would place the number 1 in the first cell and the
number 2 in the cell below in a new row.
Note: For countries that use
commas as decimal separators (for example €1,00), commas would be
replaced by backslashes () when creating arrays.
You can join multiple ranges into one continuous range using this same
punctuation. For example, to combine values from A1-A10 with the
values from D1-D10, you can use the following formula to create a
range in a continuous column: ={A1:A10; D1:D10}
Knowing that, here's a sample sheet of your data.
First Task:
create a sheet that lists all of these shift days with the date in one
column and the subject ("P: Ben" or S: Nicole") in another column.
To organize dates and subjects into discrete arrays, we'll collect them using curly brackets...
Dates: {A3:G3,A7:G7,A11:G11,A15:G15}
Subjects: {A4:G4,A5:G5,A8:G8,A9:G9,A12:G12,A13:G13,A16:G16,A17:G17}
This actually produces two rows rather than columns, but we'll deal with that in a minute. You'll note that, because there are two subjects per every one date, we need to effectively double each date captured.
Dates: {A3:G3,A3:G3,A7:G7,A7:G7,A11:G11,A11:G11,A15:G15,A15:G15}
Subjects: {A4:G4,A5:G5,A8:G8,A9:G9,A12:G12,A13:G13,A16:G16,A17:G17}
Still with me? If so, all that's left is to (a) turn these two rows into two columns using the TRANSPOSE function, (b) combine our two columns using another pair of curly brackets and a semicolon and (c) add a SORT function to list the dates in chronological order...
=SORT(TRANSPOSE({{A3:G3,A3:G3,A7:G7,A7:G7,A11:G11,A11:G11,A15:G15,A15:G15};{A4:G4,A5:G5,A8:G8,A9:G9,A12:G12,A13:G13,A16:G16,A17:G17}}),1,TRUE)
Second Task:
create a new tab which lists all the dates a specific person is
assigned too (that way this tab will update in real time and everyone
can just look at their own sheet to see what days they are on-call).
Assuming the two-column array we just created lives in A2:B53 on a new sheet called "Shifts," then we can use the FILTER function and SEARCH based on each name. The formula at the top of Ben's sheet would look like this:
=FILTER(Shifts!A2:B53,SEARCH("Ben",Shifts!B2:B53))
Hopefully this helps, but please let me know if I've misinterpreted anything. Cheers.

SUMIFS function across multiple sheets

For reference, please visit this Google Doc which is a simplified example of my problem, which is to determine total sales in Blue and Green markets each month.
Each month, I receive a new sales report from accounting for all of our markets and I add the sheet to the main workbook. My team is in charge of assigning "colors" to the markets and tracking this. As it's privileged information, we can't have accounting auto-tag these in the data they send over.
One solution would be, for each new monthly report that comes in, tag each city with the color. However, we have hundreds of markets and this isn't very practical to go through each time.
I assume that a SUMIFS function would work here, but am unsure how to set it up when there are values spread across multiple sheets.
You can use this function in B8 of February tab:
=SUM(IF(COUNTIFS($A$2:$A$5,Color!$A$2:$A$5,Color!$B$2:$B$5,'Sales February'!A8)>0,$B$2:$B$5,0))
COUNTIFS($A$2:$A$5,Color!$A$2:$A$5,Color!$B$2:$B$5,'Sales February'!A8)>0 gets an array of the countries that belong to the colour specified in A8 of the current tab (Would that be possible to put only Green and remove February Sales from that cell?).
If the country belongs to the particular colour, then return the array of corresponding values in column $B$2:$B$5.
Lastly, sum this array.
Note:
You need to array enter this formula in Excel (by holding Ctrl+Shift then hit Enter after typing in the formula).
In Google Spreadsheets, you array enter a formula by wrapping the formula around =ArrayFormula(), meaning you use:
=ArrayFormula(SUM(IF(COUNTIFS($A$2:$A$5,Color!$A$2:$A$5,Color!$B$2:$B$5,'Sales February'!A8)>0,$B$2:$B$5,0)))
In Excel you can use this "array formula"
=SUM(SUMIF(A$2:A$5,IF(Color!B$2:B$5=A8,Color!A$2:A$5),B$2:B$5))
confirmed with CTRL+SHIFT+ENTER
The same formula works in google docs if wrapped in arrayformula, i.e.
=arrayformula(SUM(SUMIF(A$2:A$5,IF(Color!B$2:B$5=A8,Color!A$2:A$5),B$2:B$5)))
or you can use FILTER as user3465711 suggests, i.e.
=SUM(filter(B$2:B$5,isnumber(match(A$2:A$5,IF(Color!B$2:B$5=A8,Color!A$2:A$5),0))))

Resources