Combining two columns & doing this for any future rows - google-sheets

I'm trying to create a formula to combine two columns but also automatically do this for subsequent items added to the list automatically. The answers are responses from a Google Form and when the form is submitted I would like the next item of the list to automatically combine the columns without needing to drag down the formula.
=CONCATENATE(I2:I," ",J2:J)
I've found a few solutions that list the items individually but want the two columns combined and then to continue for each subsequent item.

Try this formula, or see Example Sheet
=ArrayFormula(IF(I2:I="",,I2:I&" "&J2:J))

use:
=ARRAYFORMULA(I2:I&" "&J2:J)
or if you mind empty space in empty cell use:
=ARRAYFORMULA(TRIM(I2:I&" "&J2:J))

Related

How to link 3 columns together in Google sheets

I have 3 columns in a Google sheets tab.
Two of the columns are fed into from another tab (Sheet1) by the formulas =Sheet1!A2:A and =Sheet1!B2:B.
I am facing a problem when the 2 columns from sheet1 are sorted, the third column from sheet2 does not stay aligned with the other two and throws off my entire sheet's analysis. Is there a way to link the 3 columns together so when I sort from sheet1, all 3 columns from sheet2 are sorted and not just the first 2 that are being fed into from sheet1?
The short answer is that you can't. Sheets is not a relational database in which rows between sheets will remain linked.
What you can do is to work everything in a Master sheet so everything is sort together, or continue with your system but never "really" sorting your Sheet1. Instead, in any of both cases, you can use Filter Views. Filter views affect the way each user sees the information without altering the other users' views. That way you could just hide columns in Filter View in a single Master Sheet and everyone works in just one sheet; or "sort" the Master Sheet only when you're inside the Filter View, so the connected data always remain in the same rows.
I suggest you consider this possibility. Other ways are via scripts, which could be a headache by implementing it, always syncing and checking every kind of modification, sorting issue and more. Hope it's useful! There are many tutorials and documentation online; here you have just one as example

I need to compare values between two sheets to find matching items

I need to compare two different sheets to find matching values between them.
In the first sheet, I have a list of order numbers and in the second one, I have a list that needs dispatching. Therefore, without scrolling through the sheet manually for the 1000+, I'd like to use a formula or conditional formatting in order to flag the values that are the same (or all of the different values) so I can simply copy and paste this into another sheet.
I have shared a link to a google sheet below if someone could help with this that would be very much appreciated.
Edit: The second sheet (on the google document) is the list of all orders and the first are the ones to be dispatched. I need to know which one's from the second sheet are missing from the first.
https://docs.google.com/spreadsheets/d/18vSBu9GzxK1UMCE2RrDyNSH6yi-FzTvuABsVw9r172Y/edit?usp=sharing
In second sheet in column B you could do:
=COUNTIF(Sheet1!A:A,A2)
IF the formula returns 0, it means that id number is not in your first sheet.

Google Sheets filter() wrapped in arrayformula() without vlookup()

Reference/test sheet: https://docs.google.com/spreadsheets/d/1fp6ZTBtgb5E0J9GKOqh8Ae47OzY1smec5ha9BfUfAsY/edit?usp=sharing
I have a Google Sheets document with one sheet (calculator) that pulls some values from another sheet (database). database is organized by two columns: make, and model. I use some weird data validation and helper columns to make dropdowns in calculator. Then I use filter() to pull the matching value from database.
This all works fine but it will be a calculator that gets reused and the data discarded, so I need only a finite number of rows in calculator (10-20). For this, it would be super nice to be able to select the whole row and hit delete to clear the calculation without destroying all the formulas. Ideally, the filter() would happen inside an arrayformula() in a hidden and protected top row to allow the rows to be easily cleared.
For some reason though, I can't get that to work. vlookup() is not an option because I need to match two keys.
On another note, it would be nice to not need the helper columns B:J and the data validation unique to each row. This is workable though as I only need a few rows. In the actual version I hide and protect B:J and there are many more columns there.
I know you said Vlookup() wouldn't work because you need to match on two keys, I think that vlookup() will help in this situation. Try this formula...
=arrayformula(Vlookup(A3:A&K3:K,{database!A$2:A&database!B$2:B,database!C$2:C},2,False))
The concept here is to put those two matches you need into one unique key. So we use the curly brackets {} to build an array within the formula and combine those two lookup fields in your 'database' sheet. So the columns of A and B become concatenated into one element, and the second part of that array is the column C which you need.
To lookup then just combines your A&K columns similarly, so it can lookup that combined element. The rest of the vlookup follows as normal. I.e. we look up this concatenation against that one and when it matches it returns the second column of the array we built, in this case database!C.
I don't think I'm clear on your columns B:J, so I'm not sure if this helps you with that as well.
You can't get rid of the helper column approach, as long as you want the calculator to use drop down selection for the model. Data validation for dropdowns requires either a list of values, ie. static, so no good, or a range of cells.
What you might want to do is to put those cells in a totally separate tab, eg. DataValidation, and then hide that tab. Your Calculator sheet will then be cleaner, with no hidden columns. Column K will use for data validation the "hidden" values, formerly columns B:J, that are now built off in the DataValidation tab.

How to delete blank cells of the column in Google Sheets?

I am trying to get rid of the blank cells of the column in my sheet. I get some data from my colleagues via Google Form, and I have made some subcategory questions for them. So they get to select one of the five given choices. When I export the data to the sheet, it appears somewhat like below (linked):
https://docs.google.com/spreadsheets/d/1DBrFFNst0nhZAtxHejsrbNGkMxvcbOuie47era0Hl8c/edit?usp=sharing
Because the users can select one choice, out of five given choices four other cells must be left empty. Here's where I'm struggling with:
I have used filter function to get rid of the blank cells, but then it is restricted to only set the range either single row or column. So I end up with what you would see in my sample worksheet.
I've tried arrayformula and query as well, but I couldn't figure out a way out of this.
Any help would be appreciated.
=ARRAYFORMULA({B1:G7, {"subcategory"; TRIM(TRANSPOSE(QUERY(TRANSPOSE(H2:L7),,999^99)))}})

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.

Resources