I would like to use a formula in Google Sheets to lookup a key and populate a set of rows based on the key match. For example, I want to search Column A for the number 2 and get all the rows that have the number 2 and the corresponding column values. I want to do this in Google Sheets.
It sounds like FILTER or QUERY should work. See if these work as you want:
=FILTER(Sheet1!A:Z,Sheet1!A:A=2)
=QUERY(Sheet1!A:Z,"where A=2")
Related
In Google sheets, I have used a filter to fetch selective columns from Sheet A (based on some condition) to Sheet B.
In Sheet B, I have added some more columns related to the filtered columns.The issue is when the filtered columns change, my associated columns remain as it is.
Ideally they should also get altered when I am the filtered rows get changed.
I tried grouping these columns, but that was of no use.
Is there a way to append two separate google sheets sources in tableau?
Reason being is some of my sheets have exceeded the 10 million cells mark and I'm forced to use multiple sheets
The sheets have exactly the same column structure
'Join' is not the same as append. 'Join' adds columns, based on a key field, while append adds rows. Tableau calls append 'union'.
https://help.tableau.com/current/prep/en-us/prep_combine.htm
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))})
In Google Sheets, I'm trying to use AVERAGEIF to calculate an average of only some of the columns in another table.
The columns to be included in the average are marked by some text in a specific cell (e.g. the first or last row of that column).
Some columns are to be included in several averages, so the text in the top\bottom row would include several words (effectively meaning I'll need some sort of substring check such as FIND).
I've tried using AVERAGEIF() in conjuction with FIND() but couldn't get this to work.
Any ideas?
Here is an example of how the data sheet looks like, and how I would expect it to work
You can use following formula:
=ARRAYFORMULA(AVERAGE(IF(ISNUMBER(SEARCH(D2,A2:A9)),B2:B9,"")))
Edit:
For table mentioned in comment you must change ranges:
=ARRAYFORMULA(AVERAGE(IF(ISNUMBER(SEARCH(E2,$A$1:$C$1)),$A$2:$C$4,"")))
You can use a query
=AVERAGE(QUERY(TRANSPOSE($A$1:$D),"where Col1 contains '"&D1&"'"))
Functions used:
AVERAGE
QUERY
TRANSPOSE
Assume that you have a worksheet that contains two columns: unique_id and variable_a. Assume further that there are multiple values in the worksheet for each unique_id (i.e. multiple rows that start with the same unique_id). Now, my task is to aggregate all of these values by unique_id. Per the recommendation in the comments, I use SUMIF(Sheet1!$A:$A,A2,Sheet1!$D:$D) to pull all of these values. However, some of the cells for variable_a are #N/A. Obviously, this returns a #NA for the SUMIF function as well. How can I edit the SUMIF function so that it does not include these #N/A values since I do not want to filter out and delete all rows containing #NA values in the original spreadsheet?
Sample Worksheet
Output Worksheet
You can use IF function and use Vlookup as a part of it... post the example requirement, I will share you the answer...
enter image description here
You can get from below one