I am using Google SpreadSheet, and I'm trying to have multiple sheets containg a list of words. On the final sheet, I would like to create a summative list, which is a combination of all the values in the column. I got it sort working using =CONCATENATE() , but it turned it into a string. Any way to keep it as a column list?
Here is an example as columns:
Sheet1
apple
orange
banana
Sheet2
pineapple
strawberry
peach
FinalSheet
apple
orange
banana
pineapple
strawberry
peach
Updated Answer
I was right there is a much better solution. It's been posted below but I'm copying it here so it's in the top answer:
=unique({A:A;B:B})
Caveat: This will include one blank cell in certain scenarios (such as if there's one at the end of the first list).
If you're not concerned with ordering and a tailing blank cell a simple sort() will clean things up:
=sort(unique({A:A;B:B}))
Otherwise a filter() can remove the blanks like so:
=filter(unique({A:A;B:B}),NOT(ISBLANK(unique({A:A;B:B}))))
The following is the old deprecated answer
I'm confident that this is "The Wrong Way To Do It", as this seems such an absurdly simple and common task that I feel I must be missing something as it should not require such an overwrought solution.
But this works:
=UNIQUE(TRANSPOSE(SPLIT(JOIN(";",A:A,B:B),";")))
If your data contains any ';' characters you'll naturally need to change the delimiter.
The basic way, is just to do it as arrays like so
={A1:A10;B1:B10...etc}
The problem with this method, as I found out is that its very time consuming if you have lots of columns.
I've done some searching around and have come across this article:
Joining Multiple Columns Into One Sorted Column in Google Spreadsheets
The core formula is
=transpose(split(arrayformula(concatenate(if(len(A:Z)>0,A:Z&";",""))),";"))
Obviously you'd replace the A:Z to whatever range you want to use.
And if you want to do some sorting or removing duplicates, you'd simply wrap the the above formula in a SORT() and/or UNIQUE() method, like so..
=sort(unique(transpose(split(arrayformula(concatenate(if(len(A:Z)>0,A:Z&";",""))),";"))))
Hope this helps.
Happy coding everyone :)
You can use this:
=unique({A1:A;B1:B})
Works perfect here!
The unique() function gets rid of blank spaces, but wasn't helpful for me because some of my rows repeat. Instead I first filter the columns by len() to remove blank cells. Then I combine the columns together in the same way.
={filter(A:A, len(A:A)); filter(B:B, len(B:B))}
Much more simple:
={sheetone!A2:A;sheettwo!A2:A}
Use flatten, e.g. flatten(A1:B2). More details in this article.
If the 2d range is not in one piece, one can be created first with the ampersand or similar techniques. Afterwards flatten can be called on the resulting 2d range. The below example is a bit overkill but it is nice when working with dynamic 2d ranges, where the basic solution can't be easily used.
flatten(ARRAYFORMULA(SPLIT(ARRAYFORMULA(A1:A2&";"&C3:C4), ";")))
The article shows also how to easily unflatten a range using the, as well undocumented, skipping clause in a query.
=TRANSPOSE(SPLIT(TEXTJOIN("#",TRUE,TRANSPOSE(A:C),TRANSPOSE(D1:D5)),"#",FALSE,FALSE))
use a preferred delimiter absent in the data (instead of #) if needed
the first 1 (TRUE) parameter means IGNORE EMPTY, which is very important in this case..
the A:C and D1:D5 are the ranges to combine
all values remain there - not using UNIQUE
Try using your CONCATENATE argument with
=ArrayFormula(EXPAND(...))
Related
I'm trying to take the names from column A compare them to the names in column B and then have the similar names get listed in column C.
The problem is these names are automatically updated and out of order, and I need the function in column C to update with them. Also, the names will not be in order, this is why I can't use A=B function. The picture shown is an example of what the solution would look like or something similar. After completing this, I would like to continue using the same function to break down the name data even more. Watched a lot of videos on this, can't find anything specific enough to work.
Side note, I have found a way to do this using different pages within the sheets but not in the same sheet side by side. ex. of what solution
I have tried watching lots of YouTube videos, but nothing goes into detail enough and seem to only explain when similar values are next to each other in column A and B.
This is what I use for 2 different sheets but can't find / understand why when changing values in function to single sheet it wont work:
=filter(Sheet1!A2:B,ISNUMBER(match(Sheet1!A2:A,Raid1!A2:A,0)))
Also, another side note: Can't use True or False. And for uneven number of names in the list ex. Column A has 10 and B has 7 it sorts A for names in B and post similar in C.
Try below formula-
=FILTER(C3:C,INDEX(COUNTIFS(D3:D,C3:C))>0)
You can use VLOOKUP to check common values between columns and store them in another column.
=IFERROR(VLOOKUP(A:A,B:B,1,false),"")
Although this will create gaps in the output column. you can get rid of it by by simply using a filter or so.
all you need is:
=FILTER(C3:C; COUNTIFS(D3:D; C3:C))
I have a cell on one sheet of a workbook. Values can be separated by lines, or commas, whichever would make this easier.
On another sheet, I would like to display these values in different cells, individually.
Basically I would like to take this:
https://imgur.com/zYLNti2
And have it populate this:
https://imgur.com/a/CVDIuIn
While the code would be nice, I would be happy with the steps I need to take.
I can fairly easily grab the first value out of the cell using:
=LEFT(VLOOKUP(O1,Business!A:N,3),(FIND(",",VLOOKUP(O1,Business!A:N,3),1)-1))
The second is a little more tedious, I've used:
=MID(Q15,FIND(",",Q15)+1,FIND(",",Q15,FIND(",",Q15)+1)-FIND(",",Q15)-1)
Do I have to keep doing the same thing for length -1 essentially? Is there someway to simplify this or make it more dynamic?
Please excuse the sample formula cell references, I know they don't match up with the images provided. Hopefully what I'm asking makes enough sense though.
And I also just found this and it works to extract the value between the second and third comma, but I'm not really sure why it works.
=TRIM(MID(SUBSTITUTE(P16,",",REPT(" ",100)),200,100))
Instead of using Find, Mid, etc. use =transpose(split(your Cell,","))
try in D151:
=INDEX(IFEROR(TRIM(SPLIT(B151:B, ",")&" "&SPLIT(C151:C, ","))))
I have made a google form to which some answers are formatted as comma separated strings inside the automatically populated google spreadsheet. I would like to read from this sheet to another sheet and reformat the answers so that each comma separated answer is shown on a new row. I have tried to apply an ARRAYFORMULA that reads from the original sheet and then use a solution that uses SPLIT and TRANSPOSE the cell content, however combined with the ARRAYFORMULA this fails since it would overwrite contents in other cells.
Here is an example spreadsheet with the responses, a solution sheet, and a desired results sheet. https://docs.google.com/spreadsheets/d/1r_l5fVJ9lGfpubO2o3pXicV7JlZWmANjwSgNi7_DL0A
Any suggestions for how I can achieve the end result?
Okay, I assume this isn't really what you want, but visually it looks okay...
Try this formula:
={{'Form responses'!A2:A3},ArrayFormula(regexreplace('Form responses'!B2:E3,", ",CHAR(10)))}
Then format the cells so that the cell contents are TOP-aligned, instead of the default BOTTOM-aligned.
Realistically, I imagine that you want each question answer split into multiple cells. But if your data responses really contain letter values separated by commas, as you've indicated, you can still search through those cells to find whether an answer contains a certain value. It all depends on why you want the results structured the way you do.
If you can clarify what you want to do with the form results, instead of just appearing vertically for each question, perhaps we can provide a full solution for that requirement?
UPDATE1:
Okay, I may be getting close. I can get your data transformed to look like the following:
This would let you do the analysis that you want, by searching for Q.1 (question 1 responses) in the first column, and then all the answers in the third column, along with the owner in column 2. And from this, it will also definitely be possible to put the results in the exact form you want. It just may take an intermediate step.
UPDATE2:
Okay, I think I have something you can use. I can convert your data to either of the following two layouts.
The one on the right is closest to what you asked for, with the exception that the answers on the right are bottom aligned, with blanks above. But you can still process them for analysis, with queries. I honestly think having the user identifier (email address) on each row would make things simpler, but I can provide it either way.
The layout on the left is more of a traditional database layout, and would make analysis very simple. Each row has the date and email identifiers, the question number, and the answer (or one of the answers) to that question, from that user.
If this is helpful, it might be best if you enabled your sample sheet to allow us to edit it, to enable me to implement it in your sheet. But here is my sample sheet, in case anyone wants to look through it. Note that the main formula to reformat the data, in Solution!B3, could benefit from a lot of cleanup, and is probably nowhere near the best way to achieve this. Just throwing up one possible solution...
I'll try to add some explantion for the formula at some point, but ask if you have any questions.
I keep a spreadsheet with caloric information about food. Each row represents a product labelled as {negative, small, moderate} and the number of calories.
I included a shared copy of the spreadsheet.
Table
Shared table
I would like to calculate the average of the numbers that are in the same row as the keyword 'moderate'. For instance, I would like to obtain something like (890+914+731+1159+789)/5=897. I have tried =AVERAGE(B3,B7:B10) and it works but it needs to be modified when I add another product.
The expected output is in red. I want to obtain such output using formulas.
Thanks in advance
Maybe you can also consider the use of AVERAGEIF() as it seems the function is built for situations like this:
=averageif(A2:A; "moderate"; B2:B)
When you insert new row, formula will be modified automatically. Also, your formula is wrong, missing semicolon:
=AVERAGE(B3; B7:B10)
^
You can Use a IF Statement. Then you automatically do the average of the numbers IF the respective value is moderate. This is better, because it will work, if you have 5 or 5000 Moderates
Just use: =AVERAGE(FILTER(B2:B10;(A2:A10="moderate")))
You could also use SUMIF with COUNTIF, it's a more basic formula, not as powerful as FILTER, but just as funcitonal. Also to use unlimited ROWs, you can remove the number on the second part of the RANGE, this for any formula, in this case your formula would be as such:
=SUMIF(A2:A;"moderate";B2:B)/COUNTIF(A2:A;"moderate")
In Google Docs Spreadsheets, one can use Range Names to put labels on ranges of cells to make formulas more legible. In most formulas, one can use the range C:C to denote the entire C column, and C2:C to denote the entire C column after and including C2.
Is there a way to create range names of the same nature? When I try C:C or C2:C or Sheet!C:C or 'Sheet'!C:C I always get the error "The range you specified is not in a valid range format." I would like the range name to expand as my form adds rows to my spreadsheet. Thanks.
I just discovered the if you use the '-' operator, it starts from the bottom row. So,
=INDIRECT("-D:D12")
starts from the last row and works it's way up to D12!
I had a similar problem. Although I do not know how to do exactly what you are asking, you can do essentially the same thing by referencing cells that are not yet created.
For example:
Column C currently has 100 cells (100 rows in the sheet)
Instead of referencing it with C:C, use C1:C999
If you make the row reference high enough, then you can account for future rows that you will create. Hope it helps.
I don't think so... even if you select a column manually while in the Range Name selector, it complains. That would be a nice feature and it would make sense since they support column ranges for formulas already.
I believe this does work now. I have a range name of "Sheet1!A10:AW10" with no problems.
If you try to do a whole column, I think it will just take all the available cells in the column at that time. i.e. if you make more cells later, you need to manually add to the range name.
I had the same problem with ranges such as A3:A which normally work in other places such as ARRAYFORMULA(), but the workaround is to not specify the starting row, such as A:A. In cases when this would be a problem, you can proxy the data through another column using something like ARRAYFORUMULA(A25:A) as the formula.
Update: Apparently I haven't read the question properly. I see that the OP had tried leaving out the row number, so perhaps it wasn't working at that time, but it does now. The notations still don't work.
Update2: I didn't notice that google spreadsheet replaces ranges like A:A to A1:A50, so new rows added later on do not still get included. That I think is what #Dean is trying to say in his answer.
I think it's a helpful tool to use Insert -> Define new range to make a wizard appear and make the syntax correct. Hehe
My response in other topic