Can I populate a range from one sheet to another in one workbook based on if a cell is equal to something specific? - google-sheets-formula

I Have a workbook that I am using to track inventory and purchasing. The initial sheet contains the "List" which identifies if something is in inventory or if it needs purchasing, there is a data validation for "Inventory" or "Purchase" in Column E. I want to populate another sheet within the same workbook, only rows that end with the "Purchase" value in column E.
For example:
In the sheet "List", if E2 is "Purchase", I want the sheet "Shopping" to populate with the values in List!A2:D2, I've tried a few combinations of If formulas and Arrayformula but haven't returned anything but Errors
I have tried in the shopping sheet, cell A2
=IF(List!E2"Purchase",List!A2:D2,blank)
=IF(List!E2"Purchase",Arrayformula(List!A2:d2),blank)
I've done a few other variations that I can't remember the exact order on but you get the gist of the ways I've tried it.

try:
=IF(List!E2="Purchase"; List!A2:D2; )

I would use the filter function
=filter(List!A2:E,List!E2:E = "Purchase")

Related

Google Sheets Data Validation

I have a google sheet and I'm trying to validate my data properly. I need to input a value in Column G.
Conditions:
If column F is B2 to P3, the Quantity must be less than the B2 quantity.
If Column F is P3 to B2, the quantity must be less than the P3 quantity.
Attached is the google sheet. I'd really appreciate the help.
https://docs.google.com/spreadsheets/d/1z03XsplMyn3RMplxZoEizjfjB7Vr0ZEvrDLW6wQRJh8/edit#gid=0
Yes, the data validation rule based on condition of one column with different category of value from different column can be solved by using a helper column within the sheet or other sheet:
First, create a If statement with arrayformula (within current sheet or other reference sheet)
=arrayformula(IF(F2:F="B2 to P3",I2:I,H2:H))
Second, create the data validation rule based on the value of the Helper value as following then it is working as per your expectation:

Data validation with dynamic range & Vlookup formula in cell to create semi-automated list

I am trying to make a list which is partially automated by vlookup and the user complete the values (from a list) that Vlookup didn't find.
after the list is completed, the values are copied to other Sheet to save the data for analysis.
for example: column A is business names ("McBurger"), Column B is category ("Food") each category is a defined name, and column C is sub-category ("Junk").
Now, Column B (category) has Vlookup in the cell, to find (from other sheet) if the "Mcburger" was already defined as "Food". Column C also have Vlookup in the cell, to find (from the other sheet) if the "Mcburger" was already defined as "Junk" in the subcategory.
If vlookup find the match, it complete the list automatically, if not...the list stays empty and the user need to complete the category and subcategory with dynamic range from a list.
Column C (subcategory) is a dynamic range of column B(category)
from what I've tried, when column B (category) is empty, then trying to write the dynamic range in column C, gives error: Data validation in C1 =indirect(B1) because it cannot direct to a blank....
How can i create a list that part of the data that was previously filled, is pulled to the row, and the rest is manually entered by the user.
Appreciate your help in any direction to solve it, not necessarily in the way i describe above.
Thank you !

Is it possible to get the last row filled?

In gspread, is it possible to get the last row or cell number that is filled?
The API reference page doesn't seem to help.
Gspread has "row_count", but I am not sure it returns all rows in a spreadsheet, or just the filled ones. If that doesn't help, there is a slightly less direct, but completely functional way to do it:
1.) let's assume your data is in column A, and it has been filled in consecutively row by row (i.e. no skipped rows)
2.) in another free cell in your spreadsheet--let's assume cell B1--use the native Google Sheets function COUNTA, which will count the number of values in a dataset, and specify column A as the target, i.e. "=COUNTA(A:A)"
3.) now just request the value of cell B1 with gspread's acell, i.e. "last_row_updated = myWorksheet.acell("B1").value"
You can use the following code, taken from this answer to this similar question:
def last_filled_row(worksheet):
str_list = list(filter(None, worksheet.col_values(1)))
return len(str_list)

Filter Results in One Worksheet Based on the Selection in Another Work Sheet in Tableau

I am new to Tableau and I am trying to filter the results in one sheet based on a selection made in another worksheet. Below, I provide a basic outline of the problem in general terms.
Suppose I have a Sheet A and I filter on dimensions C1 and C2. Based on this I get 10 rows of my data (the original data is 100 rows, suppose). Now, I want to display only the values corresponding to these 10 rows in another worksheet B but filtered on a column C3 (not the original columns C1 and C2), i.e., I want to select the 10 different values in Column C3 and show results in sheet B corresponding to these values.
I tried Filter Action but it seems I can create filters based on the filters I have chosen on Sheet A, i.e., C1 and C2. How can I create a filter corresponding to column C3?
Thanks for your help. Please let me know if the question is too general or not clear.
I didn't totally understand your question but will try to help with whatever I understood.
You can create a filter for Column 3 in the second sheet and when you use action filter in Sheet 1 in dashboard it shows the data based on the action filter and also the filter for Column 3 set for sheet 2.
You can also use parameter.Firstly create a parameter for column3. Create a calculated field using that parameter and use the calculated field as input for the graph or table you create in sheet 2.
Refer these links for calculated fields and parameter:
https://www.interworks.com/blog/rcurtis/2016/05/26/tableau-deep-dive-parameters-calculated-fields
https://www.interworks.com/blog/anonymous/2012/03/26/how-create-and-use-parameters-tableau

Empty filter results gives #VALUE! error

I've been working on this project where I need to consolidate data from two other sheets within the spreadsheet and filter the result for easy viewing. But I realized the problem when the filter gives no result there will be a #VALUE! error. The error isn't solved even when I have used IFERROR.
Link to the sample of the Google Spreadsheets.
There are two classes and I wish to filter out those who passed in the class and populate the table in the collated sheet.
You should be able to do something like this:
=query({Class1!A2:C; Class2!A2:C}, "where Col3 = 'pass'")
(change the sheet names and ranges to suit !).
(Also check the formula I entered in A1 of sheet 'JP')

Resources