Google Sheets: Group Values in rows based on duplicate value in column - google-sheets

I am trying to sort Google Sheets data in columns.
Raw Data
Desired Output
I know that this can be offered with some time of QUERY function but I cannot get it to work exactly how I want. I have already read through this thread on Google Sheets and this thread on Excel.

I don't think query can do exactly this: it can aggregate data in a few ways, but not in the way of "take the values and arrange in a row". I would use unique and filter for this purpose. Assuming the input columns are A,B and the output columns are C, D,... the formulas would be
C2: =unique(A2:A) to return the team numbers without repetition
D2: =transpose(filter(B2:B, A2:A=C2)) to return the matching scores, transposed to become a row.
The formula in D2 needs to be copied/dragged down the D column.

Related

How to create a Google Sheet table of ranked person by date and rank from a list

I have a Google Sheet with daily ranked items expanding with new data everyday in the Raw Data Table A2:C.
I would like to generate a report matrix similar to table in E2:J using one formula so that we don't need to manually copy formulas in each cells in the report table from time to time.
It would be ideal to have one formula at cell E2 (or E3, F1, F2) only that will automatically generate as many rows and columns in the report table based on the data in Raw Data Table. This way, the report table will not needed to be maintained on a daily basis (like copying formula everyday as data expanded).
There are less elegant ways to do it like pre-copy formula into a large number of cells or using Google App Script to generate the table. However, I believe an advance query() or a complex formula mixing query(), filters() and/or arrayformula() can do the job! Just wonder if anyone of the Google Sheets query() expert can help!
try:
=QUERY(A2:C; "select A,max(C) where A is not null group by A pivot B"; 1)
Here's a possible solution:
=ArrayFormula(LAMBDA(dates,ranks,{A2,ranks;dates,IFNA(VLOOKUP(dates&ranks,{A3:A&B3:B,C3:C},2,0))})
(UNIQUE(A3:A),TRANSPOSE(UNIQUE(SORT(B3:B)))))

ArrayFormula to automatically calculate specifics columns

I want an array formula to use with Google Forms data to automatically calculate running metrics on my data.
In this case, in column H, M, R and S I want it to auto-calculate whenever new responses come in. Columns H, M and R are ok except for column S.
I'm trying to use this formula below for the sum of each row in these specific columns H, M and R results in a grand total at the column S but isn't working.
=ARRAYFORMULA(SE(A2:A="";; MATRIZ.MULT(H2:H+M2:M+R2:R; TRANSPOR(SINAL(COL(H2:H+M2:M+R2:R))))))
What I'm doing wrong?
My Google Sheet:
https://docs.google.com/spreadsheets/d/1c6ZLnonx8BZ_KV0elW5xiuyQZPi86LOIUzdyVbBHAXQ/edit?usp=sharing
You have this at the beginning of your formula:
SE(A2:A=""
But A2:A is blank for all rows. So you are getting blanks in Column S, because that is what you instructed the formula to do.
Since you know that you will have something in R2:R of every active row, just change that segment of your formula to the following:
SE(R2:R=""
However, you are adding formulas directly to the form intake sheet. This is never a good idea; it can cause many problems. The professional standard is to leave form intake sheets alone, with no additional formulas, columns, conditional formatting, etc. Instead, use a separate sheet to bring over results from the form intake sheet and then process/add in that second sheet.

Google Sheets: How set value from two matched columns?

i'm trying to transform data from a row only list to a row-column structure.
I got data in I:K and want to set the values from K to the corresponding cells in A:H where Date and Time Values from I & J have to match within A:H.
example sheet
Does anyone know how to do this with Google Sheet system functions?
Yes, it can be achieved by using sumifs formula, simple and straightforward, here is the formula:
=SUMIFS($I$2:$I$13,$G$2:$G$13,$A5,$H$2:$H$13,D$1)
And this is how the Gsheet look like, accept if helping you :)

Utilising COUNTIF in array formula in Google Sheets

I have some data that I want to summarise at a grouped level, where the possible values for each group are given as a pipe-delimited string. I then perform a sumifs by summing over multiple arrays, one of which includes a COUNTIF() with a SPLIT() in order to establish if the row features in this set of values.
The formula works fine but I would ideally like it to function as an array formula so that if the number of groups changes, the number of rows the formula is applied to will also change.
See sample sheet here. Raw data is in the tab "data", the groupings data is in the tab "Groupings" and it is the formula in column C on the "Summary" tab that I want to make work as an array formula.
I think the easiest way to do this is to mark the Group on the Data sheet and then use a traditional query to add up the groups. This vlookup should do it in cell D1:
=ARRAYFORMULA({"Group";IF(A2:A="",,VLOOKUP("*|"&A2:A&"|*",{"|"&Groupings!D:D&"|",Groupings!C:C},2,0))})

Filter one sheet by a range in another sheet

I have a Google Spreadsheet document that I'm using to maintain a reference of all business logic on various systems. It is comprised of 2 sheets:
Sheet1 is a view of all of the logic. Each row has a unique code column (column B) and many details about the logic being done in other columns
Sheet2 is a mapping of the systems to the logic. Each system is on one row. From column E onward, each cell is exactly a code from Sheet1
The relationship between code and system is many to many, so the same code may be used by many systems, and each system may have many codes.
I would like to be able to filter Sheet1 based on whether the code column in each row is found for particular systems.
Example
System A and System B are in Sheet2 rows 50 and 51
Their codes are from column E to K
Filter Sheet1 by code where code is contained in Sheet2!E50:K51. The end result should be Sheet1 shows only those codes (and of course all columns for them)
I have seen and tried a bit of the usual suspects (ARRAY_FORMULA, INDEX, LOOKUP) but I do not yet grok them fully. I thought the answer would be going to "Filter -> By Condition -> Custom Formula is" but I'm not sure what to put there.
Any help is greatly appreciated!
Short Answer
In custom formulas of filters use INDIRECT to refer to ranges in another sheet.
To test if a value is in a 2D range, compare the value and the range, coerce booleans to numbers and sum them.
Explanation
Part 1: Custom Formulas in filters
Custom formulas in filters and conditional formatting rules can only reference the same sheet, using standard notation (='sheetname'!cell). To reference another sheet in the formula, use the INDIRECT function.
Example
Assuming that the filter criteria are in A2:A3, the filter custom formula in in a sheet called Sheet1 is:
=ISNUMBER(MATCH(A2,INDIRECT("Sheet2!$A$2:$A$3"),0))
Part 2: Test if a value is included in a 2D array
LOOKUP only could look for values in a single column or single row, by the other hand AND and OR functions can't be used in array formulas so, instead of use them we will compare a scalar value with the 2D range. This will return a 2D array of TRUE/FALSE values that we will coerce to number (1 for TRUE, 0 for FALSE) and sum them.
The final custom formula is the following one:
=ArrayFormula(SUM(N(A2=INDIRECT("Sheet2!E50:K51"))))
References
Filter your data
Apply conditional formatting rules

Resources