SUM based on a comparison of a list in a cell to a list of items - google-sheets-formula

I have one table with a list which includes a reference cell with 1-more items separated by a comma.
I have another table with a list of all reference items, and a column with a value.
What is a way to create a formula that compares each item in the reference cell against the reference list, and if there is a match, returns the sum of the reference items value.
See this table
i.e. match column V to B, and if there is a match, sum column Y.
Thanks
Reza
I was struggling to find a way to search for a method to do this so though I would just ask.

Related

Googlesheet extract specific text from cell, based on range

I've got a problem, I'm not sure can be done with formulas.
I can do it with some script writing, but would prefer the sheet be "Live" and use formulas.
I have a list of products, and within the name of the product is the type of product it is (T-shirt, Sweatshirt etc)
But it's not always in the same place, I have a list of Types, and what I want to do is create a formula that will populate pull the type from the name if it finds it in my List
(hope that makes sense)
https://docs.google.com/spreadsheets/d/1DXmEbzJS02oMlGYrKI6XsUPuyCI9XqoRo2_4GZXIZN4/edit?usp=sharing
This is a sample of the data, I've got Product Titles in Column A, The Expected output in column B, and the list of types in column F.
I've tried using a combination of find and mid commands, but can't figure out how to get it to compare with every type in my list.
Assuming A2:A contains product names, F2:F contains a list of product types, and we want C2:C to contain product types extracted from product names in A2:A, then it can be achieved with the following formula in cell C2:
=ARRAYFORMULA(IFERROR(REGEXEXTRACT(A2:A,JOIN("|",
QUERY({F$2:F,ARRAYFORMULA(LEN(F$2:F))},
"select Col1 where Col1 is not null order by Col2 desc")))))
Explanation
REGEXEXTRACT, extracts a substring that matches a regular expression. x|y matches x or y, preferring x. We construct a regular expression containing all product types from the list (F2:F), delimited by | using JOIN.
The list of product types is first sorted descending by string length, so that REGEXMATCH will try to match the longest types first. It doesn't matter in the particular example sheet you provided, but would be necessary if you had a type that is a substring of another type, e.g. Shirt and Polo Shirt.

How do I FILTER cells based on two drop-down list conditions?

I need a FILTER formula to get an output of the cells within the range of the two labels matching the conditions from the two drop-down lists.
For example, given the below sheet, I need the output to be what's highlighted, given the two conditions from the drop-down lists:
I also need to be able to add more date rows, expanding downward.
I've tried using QUERY:
=TRANSPOSE(QUERY(Accounts!B2:F, "SELECT * WHERE B="""&B2&""" ",1))
This only gives me the row of contents (apple, carrot, cake, steak, soda).
Here you can find my solution:
https://docs.google.com/spreadsheets/d/1cWBLLmJx6mTlYrvPRvRE_y9NpBOJj_ILBgXmoB9suv4/copy
Note that when you merge cells, the value is only in the top one or the leftmost one. So if you have multiple rows for each data, you should multiplicate these cells.
I make additional column for this - first date I just copy and below it I insert a formula: (in H5)
=if(isblank(A5),H4,A5) - it says - if cell in column A is empty, take value from above, but if you find something there, put it here. Then I copy this formula down the sheet.
Then it gets easier.
To filter with data validation you have to first find right column using formulas INDEX and MATCH and then filter it against data values in additional column.
Does it work for you?

Google Sheets sum mapped text values by group

I'm looking to count the groups that have at least one occurrence of specific text values in a column. E.g., if any of term_01, term_02, or term_03 are in column B, for 1 or more records associated with a specific value in column A, count 1.
This is not too difficult with a helper column, but I'm trying to do it in one go, with a single formula.
Another way to think about this is that unless every record for a given column A value (e.g. group_01) has a value of term_04 in column B, add 1 to the value displayed in cell I1.
Solution with a helper column:
The helper can be created with an array formula:
Unfortunately, replacing the [sum_range] in SUMIF() with an array fails with "Error: Argument must be a range"
Is there a way to pass an array of values to SUMIF() instead of a range? Am I going about solving this problem the wrong way?
I would still be interested to know if there's a general solution to the question asked in the title, but I solved this specific problem with a slightly different approach.
If the number of records with a term_04 value equals the total number of records for that group, assign 0, otherwise assign 1, and sum the result.
=ArrayFormula(SUM(IF(COUNTIFS($D$3:$D$10, UNIQUE(D3:D10), $E$3:$E$10, $A$6)=(COUNTIF($D$3:$D$10, UNIQUE(D3:D10))), 0, 1)))

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 !

How to identify a Specific WebElement which is a child of WebTable in UFT

I have a WebTable, which has some WebElements. I want to verify the text of one of the WebElements and take action on it. Can you help, how to proceed on this?
As Vinoth said if you know which row and column the element is in you can use ChildItem.
Typically UFT flattens the elements (so that a WebElement in a WebTable will appear as the WebTables sibling if both are added to the repository. However something that many people do not know is that if you manually put an element under the WebTable (or any other element) then UFT will look for it under the parent object.
This means that you can describe the nested element and UFT will only look under the table and not in the rest of the page.
Browser("B").Page("P").WebTable("T").WebElement("innertext:=.*bla.*").Click
You can use ChildItem method of WebTable.
Set MyWebElement = Browser("CreationTime:=0").Page("micclass:=Page").Webtable("name=TableName").ChildItem(Row, Column, micclass, Index)
Row - Required. A long integer value.
The row number where the cell is located. The first row in the table is numbered 1.
Column - Required. A long integer value.
The column number where the cell is located. The first column in the table is numbered 1.
MicClass - Required. A String value.
The object type.
Index - Required. A long integer value.
The index of the object of type MicClass in the cell. This index indicates the desired element when there is more then one object of type MicClass in the cell. The first object has an index of 0.
MyWebElement is the element you wanted. You can access any methods/properties of WebElement. For ex, to click,
MyWebElement.Click

Resources