How to create a list in a new column when data in another column is > ..% with the conditional formatting included? - google-sheets

I have a Google Sheets project with a table in there. The cells percentages change every now and then (external API kind of add-on) and I would like the column to be checked if a certain percentage is met. If it is, the corresponding name in column A should be copied in column D let's say. So example:
A formula something like: if a value of column C > 5%, copy the corresponding name in column A to a new column D. But the main thing is that it shifts everything up so there are no gaps. If I refresh the data, it should create the list again with no gaps and remove the former data that doesn't meet the requirements anymore. Please help!
P.S. I would also like the background color of column C (conditional) to copy to the new column

use QUERY
=QUERY(A2:A, "where A > 0.05")
and then all you need to do is select Greater then in CF rules:

Related

Get Values From a Specific Column Into a Dropdown

Want to ask if there's a quick way, an automated or using formulas for this scenario.
So I have "config" sheet, and each columns is a list used for a specific dropdown.
config!A:A = clientA
config!B:B = clientB
In a "summary" sheet, I need to add a dropdown in column C depending on the column A
For example summary!A2 contains "client A" so the dropdown in summary!C2 will show the list of clientA
And summary!A3 contains "client B" so the dropdown in summary!C3 will show the list of clientB
What I currently do is named the range each in the "config" then in "summary" I put the Data Validation for the specific name.
I was wondering if there's a custom formula that I can put in the Data Validation for Column C that depends on the value in column A. The only challenge is there are spaces so in the Named Range I remove the space. And since it depends on the column, the row number is moving.
Looking for a formula since I am avoiding App Script for this specific file. Thanks
Hopefully someone could help me on this.
Thanks much.
You are all awesome!
What you can do is set an Auxiliary sheet (or extra columns far in "Summary"). You can set Summary!C2 the next Data Validation:
=Auxiliary!A1:1
Open the settings of that data validation and make sure there are no anchors (no $, for example A$1). If there is some, delete them
Close it and then copy and paste special - Data Validation only to the rest of the cells
This way C2 will be associated with row 2 from Auxiliary, C3 with row 3 and so on
Then, you can go to Auxiliary and set a formula in each row to filter the values according to B2, B3 (or however you identify the client... (a Query, or Filter) --> You'll probably need to transpose the information, so the list becomes a row
With that done, each data validation will depend now on the value of that row
Re-reading your example, you can do the same but instead of filter you can transpose the entire Config sheet and you'll have a row per client
......
You have an example here: https://docs.google.com/spreadsheets/d/1jF5XoBkQll5tHEjADg508NMznmbuB43tyWv5R2S1mM8/edit?usp=sharing

Use Arrayformula to auto-populate column in Google Sheets based on condition

I'll do my best to explain this. So, I want to use Arrayformula to autofill column based on a condition.
=IFERROR(QUERY(ARRAYFORMULA(IF((Research!$B$1:$B$100)="Yes",REGEXEXTRACT(Research!$A$1:$A$100,".*"),)),"WHERE Col1 is not null")).
It does what it's supposed to, but the problem comes if that condition changes at any point (so it's not true anymore) the value in the cell filled with the array will get deleted but will also offset all the other rows after it (same happens if I insert new row with 'Yes' value in between other rows, in my Research sheet from where I extract my data from).
Is there any way if I need to make changes to the condition in the sheet from where I extract data > and not offset everything else in the sheet where I use the array formula? (either delete the entire row if the value doesn't meet the condition anymore, or insert new row if it meets the condition (not just replace the value in previous cell in its spot, cuz then all the other fields are mismatched). I'm a beginner with excel, I hope that makes sense. Sheet ex
Condition in Main Sheet > Result in Array sheet
(these are the ok examples)
Changed value to yes for Agency 3 > Inserted in Agency's 5 place > and offsets everything after it
Please refer to the spreadsheet for my examples.
Method A: Separate the sheets of input and output
Method B: Input on Research and output on Initiative
Method C: Use Google Apps Script to 'avoid' offset upon change of Take? value. (example is not provided)

Query and ImportRange with Dynamic Values

I have 2 sheets which are connected.
Sheet-1: Has ID column and Status column (Status field is manually updated by the team)
Sheet-2: Has ID column and Status column (+ many other fields)
Requirement: Status column in Sheet 2 to be updated from Sheet-1 if ID column in sheet-2 = ID column in Sheet-1
I wrote a Query and ImportRange, but I could find Query working only when I compare it against a static value (for e.g. Yes). What I want is it to check against the value in ID column from both the sheets and import only for rows that match.
=QUERY(IMPORTRANGE("1ZkPaYb1IIIkcbVerdmZ-Ru1vxFu1YMWj74QNQj2jles", "Ops Action Sheet!B2:B10000"),"select Col2 where Col1 = 'Yes'")
This doesn't directly answer your question about using QUERY, but I believe that that function might not be the best tool for what you're trying to do.
I write below a solution using the alternative function VLOOKUP.
I am assuming here that by "Sheet-1" and "Sheet-2", you actually mean entirely different spreadsheets, judging by your use of IMPORTRANGE.
If you don't mind having a copy of Sheet-1's contents living within Sheet-2, here is what you can do:
On a new sheet (tab) in Sheet-2, copy this function (fill in sheet_1_url):
=IMPORTRANGE("sheet_1_url", "Ops Action Sheet!$A:$B")
You should see a copy of the data from Sheet-1 in that tab. You can hide this tab or protect it if you wish.
On your main data tab within Sheet-2, copy this formula in your Status column (assuming that your ID is in A2:
=IFERROR(VLOOKUP($A2,range_from_step_1,2,),)
Copy that formula down as much as you need.
However, if you don't want to have a copy of Sheet-1's data in Sheet-2 for whatever reason, you can simply skip steps 1-2 above, going straight to step 3, with the following formula in Sheet-2:
=IFERROR(VLOOKUP($A2,IMPORTRANGE("sheet_1_url", "Ops Action Sheet!$A:$B"),2,),)
Not that I recommend it, since you'd technically be importing your data virtually within the formula N number of times, which will be a huge performance hit.
You can see the references for the formulas used above here:
IMPORTRANGE
VLOOKUP
IFERROR
edit to reflect and paste in spreadsheet 2:
=ARRAYFORMULA(IFERROR(VLOOKUP(A2:A, IMPORTRANGE("ID", "Sheet!A:C"), {2, 3}, 0)))
A2:A - column of IDs in spreadsheet 2
Sheet!A:C - column A of this range hosts IDs
{2, 3} - brings column B and C from spreadsheet 1 into spreadsheet 2

Google Sheets - Use current content of cell in formula

I need to generate hundreds of unique products into a sheet with currently only 14 products. In the 'handle' column if you add a random number to the name/string this will be enough to generate a new product in a Shopify database once you reimport the CSV into the database.
To generate a random product 'handle' I add this formula:
=JOIN("-","dress",RANDBETWEEN(1,1000) )
But I don't want to manually type the string portion 'dress' into the formula. Is there a function to grab the current contents of the cell
try simple:
=JOIN("-", A1, RANDBETWEEN(1, 1000))
where A1 = "dress"
for array/range do it like this:
=ARRAYFORMULA(A1:A10&"-"&RANDBETWEEN(ROW(A1:A10), 1000))
I am not entirely clear of your requirement but suggest an alternative to your formula:
=A1&"-"&B1
assuming "dress" is in A1 (and similar values below it) and that B1 is populated with:
=randbetween(1,1000)
and that is copied down to suit before the whole column is copied and Paste special, Paste values only over the top. This would facilitate the removal of duplicates (if desired) and provide an audit trail while reducing processing requirements.

Autofill a column in Google Sheets as new rows are submitted through Google Forms

I have a google form that has fields taking up 7 columns in the response sheet. I have reserved the 8th column to compute few fields (basically a formula) and generate a unique ID for that response. I know that when new responses are added, I can drag the box of the 8th column field all the way down to the given number of rows to auto-fill the column. But this type of auto-fill requires a manual effort. What I want is an automated system to keep filling in the column with my formula.
I have tried pulling the column down beyond the current number of rows in a hope for it to auto calculate when the new row is added but a new response simply overwrites the entire row instead of filling in just the seven columns which deletes the 8th column in that row.
The spreadsheet is
https://docs.google.com/spreadsheets/d/1HM2dDRtkF_KlQ8SKoeW2YmjP2dttYAk1_4iCYBVEN8o/edit?usp=sharing
The responses fill up to column H (Member #3) and my desired column is column I (Registration ID) which is aided by column J, K and L.
You can try using
=ARRAYFORMULA(IF(ROW(M:M)=1,"Registration_ID",IF(C:C="UM-DAE CBS, Mumbai", "cbs"&"_"&J:J, IF(C:C="ICT, Mumbai", "ict"&"_"&K:K, IF(C:C="IISER, Pune", "iiser"&"_"&L:L,"waiting for a response...")))))
Just some explanation:
//This one is just to label the first row as Registration_ID so you can replace M:M with any column you want.
IF(ROW(M:M)=1,"Registration_ID"
My first time answering in Stack Exchange so I'm not familiar with the formatting.
Also a heads up, if you wanted to use ArrayFormula() with an If(AND()) or If(Or()) function, just know that the ArrayFormula() requires you to use arithmetic functions like "*" or "+" instead.
So IF(AND(A,B)) will be IF(A*B).
Use the "CopyDown" add-on for Google!
On your Google Sheet that your Form posts to, click Add-Ons > Get Add-Ons > type "copyDown".
This add-on quickly & easily allows the sheet to automatically copy the formula from one of your top rows (adjustable) to the rest of the form's submissions.
Love it!

Resources