Google Sheets - How to join cells into one that meet a condition - google-sheets

I would like create a new sheet in my document and combine all values in Products sheet from column A (from A2) into one on the new sheet, when Current Stock (calculated) is greater than 1 (preferably only non blank cells):
Currently I am using formula:
=JOIN(";",Products!A2:A,"")
How can I add here check for Current Stock?

Try-
=JOIN(";",FILTER(Products!A2:A,Products!H2:H>0))
H2:H>0 will filter out non blank number values cells.

Try
=JOIN(";",FILTER(Products!A2:A,LEN(Products!H2:H)))
the condition is for lenght > 0, you can modify with what you want.
Bye

Related

Google Sheet: Exclude a row from counting based on value of another column

I have a Google sheet as follows:
I am counting all "yes" in column B based on the formula =COUNTIF(B2:B6,"Yes").
However, I would like to exclude row 5 based on the value "EXCLUDE" in column A.
How can I perform such filtering?
you can try either:
=COUNTIFS(B2:B6,"Yes",A2:A6,"<>"&"EXCLUDE")
OR
=COUNTA(IFNA(FILTER(B:B,B:B="yes",A:A<>"EXCLUDE")))
try:
=SUMPRODUCT(B2:B6="yes"; A2:A6<>"exclude")

Counting Cells with Specific Strings Row by Row (IF AND Statement?)

Summary
Goal: count cells that contain specific strings in columns A AND B checking each pair of rows in the columns.
What I have So Far: =IF(AND(B3="GA", C3="Grocery"), COUNTIF(C3, "Grocery"),0)
What I Need: how to specify continuing this process for each pair of rows in columns A and B.
Context: counting business in different states that have been assigned specific categories. For example, how many businesses in Georgia ("GA") are categorized as "Grocery"?
Example Google Sheet
Details
I am creating a function with the goal of checking cells in columns A and B in the same row to match a specific string for each, adding +1 to the count if they both match, then checking the next row in columns A and B. How can the function be written to continue checking all of columns A AND B row by row?
Thank you!
Try something like-
=BYROW(FILTER(B3:C,C3:C<>""),LAMBDA(x,IF(AND(INDEX(x,1,1)="GA",INDEX(x,1,2)="Grocery"),COUNTIFS(C3:C,"Grocery"),"")))
Or try-
=BYROW(B3:C,LAMBDA(x,IF(AND(INDEX(x,1,1)="GA",INDEX(x,1,1)<>"",INDEX(x,1,2)="Grocery"),COUNTIFS(C3:C,"Grocery",B3:B,"GA",INDEX(ROW(C3:C)),"<="&ROW(x)),"")))
As per sample sheet provided in comment, you can try this formula.
=COUNTIFS(C3:C,E16,B3:B,"GA")
try:
=INDEX(IF((B3:B="GA")*(C3:C="Grocery"),
COUNTIFS(C3:C, "Grocery", ROW(C3:C), "<="&ROW(C3:C)), 0))

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)

Copy a NB.SI formula into a Google Sheets sheet

I am turning to you today for help with a problem on Google Sheets.
I receive this data from a Google Sheets form: An answer (0 or 1) to 5 different questions.
I would like to calculate in column A (in green) the scores out of 5 for each row, as soon as a new row is added by the form.
I tried to use the ARRAYFORMULA() function but it does the count for all the cells in the range and not just row by row:
Do you have an idea to have a score out of 5 for each line of question and have it apply to the whole file as soon as a new line is added by the Google Form?
Thanks for your help
If you want to use COUNTIF (English correspondance for NB.SI), modify your formula to:
=ARRAYFORMULA(COUNTIF(IF(B1:F=1,ROW(B1:B)), ROW(B1:B)))
or for your regional settings:
=ARRAYFORMULA(NB.SI(IF(B1:F=1,ROW(B1:B)), ROW(B1:B)))
You can get a row-by-row sum with sumif() like this in cell A3:
=arrayformula( sumif( if(column(B3:F), row(B3:F)), row(B3:F), B3:F) )
This formula uses open-ended range references so it will create results all the way down to the end of the sheet. To limit that, use a range reference like B3:F100 instead.

How to get row List elements compare by two rows Google Sheets

I have spreadsheet https://docs.google.com/spreadsheets/d/1qjvn90lZ7AWhYApChd2gAKHzZqmnNz4xlURENSQasaw/edit#gid=0 and i want to get rows with some differences by unique values Id and Updated at.
List №1 i have the same automatic importing data http://prntscr.com/t3axvt
In List №3 i try to use =UNIQUE('List1'!A2:A;'List1'!D2:D) http://prntscr.com/t3ayx8 but it didn't work
Question
i need to get rows from List1 if there are duplicates with these parameters Id and Updated at first row from duplicate rows (must be like this http://prntscr.com/t3b3nb) or last row from duplicate rows (must be like this http://prntscr.com/t3b3nb).
You can create a helper column to achieve this
Create a helper column J and put the below formula in J2
=arrayformula(if(D2:D7=OFFSET(D2:D7,-1,0),"",ROW(A2:A7)))
Then you'll be able to filter your data, put below formula in A10
=FILTER(A2:J7,J2:J7<>"")
Please amend your data ranges per your requirement
Please use ; instead of , if you in are different continent
for Extended Range, use below formula
=arrayformula(if(D2:D="","", if(D2:D=OFFSET(D2:D1000,-1,0),"",ROW(A2:A))))

Resources