How do I automatically add rows in google sheets with cell condtion? - google-sheets

I am working on a sheet where I may have to automatically add a row based for product that is ordered. the first row contains the customer information I need add rows between customers if they have ordered more than one product, I am looking for a way to list the products on a new row between each customer data row. Basically I want to do a transpose function but add a new row for each product. Is there a formula to do this? Sample of my data and how it needs to be displayed Additionally I would like to add a product description from a VLOOKUP with each new product row as well.
I am not quite sure how to use the array formula but looks like it might be an option. Transpose but add a new row is the best description I can come up with for this.

Related

Making a drop down populate sheet from a database

I have two sheets in my document. The first sheet’s columns are days (A-C) and the rows are specific attributes for each day (temperature, cloud cover, rain, etc).
On the second sheet, I have a data validation drop down selector, it’s contents sourced from the “Days” strip (A-C, so it displays A-C as options) in sheet one. When I select day C for example, I want all the attributes for that day to populate in cells down the page. It should update depending on which page is selected.
Much appreciated, thank you.
Image: https://ibb.co/DgvnLLc
Use MATCH to find the column index that corresponds to the dropdown value.
Use OFFSET to retrieve the corresponding column data.
=OFFSET(Sheet1!B3, 1, MATCH(A2,Sheet1!B3:D3,0)-1, 3)

How do I populate an empty array, with a specific table in another sheet, based on dropdown menu?

How can I populate an array, with a specific financials table from another sheet, depending on the chosen company in the dropdown list?
SO... populate the blue-area in DASHBOARD!, with the blue-area in FINANCIALS!, because it matches the company in the dropdown menu on DASHBOARD!.
Or is there an easier way to do this. In essence... I want the chosen company's key financials to be shown, when it is chosen in the dropdown menu...
Thank you so much in advance!
GOOGLE SHEETS LINK
You can try the ‘QUERY’ function.
In the “FINANCIALS” sheet - Column A , I added the name of the company (you can hide this column if you prefer). This way we can make a query and return only rows that match with that specific company.
In the “DASHBOARD” sheet, cell D15, I added the following:
=QUERY(FINANCIALS!A6:H42,"select C,D,E,F,G,H where A='"&B10&"'",0)
And after formatting the rows with Number/Percent, this is the result which matches with the information in the "FINANCIALS" sheet:

Google sheets: Filter sheet so it shows or selects only columns containing string

I have a google sheet with many columns, and I want to select (or filter) all of the columns whose labels contain the string "xyz" in them. Is there any simple way to do this?
The only way I've been able to do this so far is by Cmd + F to search the sheet for "xyz" and then manually select all of the columns with my mouse.
Context: The data is from a survey where participants evaluated 10 products. For each product, they answered the same set of questions. The way the data reads out to a sheet, each question gets a column. So that means there are 10 columns, for example, where I'm asking "how likely would you buy this product?" I want to select all 10 columns that ask how likely they would buy x product so that I can copy these columns, paste them into a new tab, and analyze them. These 10 columns all contain in their labels the string "how_likely", so I'm trying to select these columns by somehow searching for all columns that contain that string.
You can achieve this by doing a couple of preparation steps as follows:
Create a sheet where you list the unique part of the question title (eg. "how_appropriate" , etc.). I named it "QuestionsList" and it looks like this:
Create a sheet where you transpose the data in "FormData". I called this sheet "TransposedFormData" and it looks like this:
Use =TRANSPOSE(FormData!A1:H16) in cell A2 for it. I wrote the header names for easier visualization, but they aren't required.
Now that you have the data prepared, lets get the desired output.
In the sheet "DesiredOutput" in cell A1, write the following formula:
=Transpose(QUERY(TransposedFormData!A:P,"select * where A contains '"&QuestionsList!A1&"'",0))
Notice the desired output: corresponds to only one question (the one listed in QuestionsList!A1). So you will need a "DesiredOutput" sheet for each of the question titles, and on each change the row number in QuestionsList!A* where "*" represents the row number of the question title you want.

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

Display columns of information in Google Sheets based on Drop down selection

What I am looking to do is have a list of items in a dropdown list in cell A1. Lets say the list is "Presidents, Movie Stars, Rappers".
When I select Presidents I want Column B in Sheet 1 to list all the presidents with column C listing their party they represented and column D to list their years in office. When I select Movie stars I want column B to List various Movie Star names, Column C to list number of movies starred in and Column D to display their highest paid film.
So in short I want 1 dropdown to populate 3 columns worth of data.
Everything I have looked up uses scripts(which I think this is completely doable without using) uses VLOOKUP but has 1 cell worth of data appear(ex, A1 dropdown displays data in A2 but not data in B1:B50, C1:C50, and D1:D50) or doesnt worth with multiple columns of data. I am fine if the data pulls from another sheet I just think there is a better way to do this then filling in 200+ cells with an if:then function based on my selection in cell A1. Anyone know an easy way to do this?
An elegant solution, in my opinion, is to do something like the following:
Create a column (which you can later hide) that has all value combinations, with a delimiter between the values. For example, you could have "Presidents>Barack Obama>Democrat>2008-2016"
Then create a simple function (no VLOOKUP needed!) to pull the individual values by using FIND to findn the location of the delimiters and split the combination.

Resources