Google Sheets SUMPRODUCT/COUNTIF formula question - google-sheets

I am currently working on a google sheet where I'm counting the number of schools that have a device assigned. One of the ranges that I'm pulling contains duplicate device serials from another column.
My question is what would be a good formula given that i'm counting column A but i want to not include anything that might be a duplicate in column C.
For example:
A---------------B-----------C
RHS---------date------0011
EHS---------date------0082
EHS---------date------0064
EHS---------date------0082
SHS---------date------0058
I want to count EHS in Column A but exclude the duplicate number in Column C. The answer should be 2
Thank you for any help!

You can use COUNTUNIQUEIFS():
Formula in E1:
=COUNTUNIQUEIFS(C1:C,A1:A,"EHS")

Related

Google Sheets- Tally unchecked boxes across multiple sheets

I humbly seek your help.
I'm working on tabulating a bit o' data for a project at my school.
Spreadsheet Info
I have a spreadsheet where teachers have to click their name (which is linked to their own sheet). This brings the teachers to a sheet that contains the roster of their homeroom students. The teachers need to tick a box in columns B, C, and D to indicate if the students brought their charged chromebook, their charger, and their sleeve. They left the box unticked if the student did not complete this task. This spreadsheet contains 70 teacher's names and 1800 student names.
What I'm seeking help with
The teachers have completed their task- and I'm trying to tabulate the # of unchecked boxes for each column (B,C,D) per teacher (or, per sheet). I know how to sum the unchecked boxes. What I need help with is trying to find a way to apply a formula across 70 sheets w/ unique names (without manually typing each unique name in a formula). My limited formula knowledge results in being unable to copy down (or across) formulas when the sheet name is referenced via link in a column.
Simplified Example Sheet:
I have a simplified example linked below.
https://docs.google.com/spreadsheets/d/14MyEFUwm-QmdTf7oxrnJPnoZJEGyS32fAqmttalraCI/edit?usp=sharing
Thank you in advance, I appreciate the recommendations
I attempted the =sum(indirect) formula, but was unable to get that to work
try this formula in your sheet:
=MAKEARRAY(COUNTA(A2:A),3,LAMBDA(r,c,COUNTIF(INDIRECT(INDEX(A2:A,r)&INDEX({"!B:B","!C:C","!D:D"},c)),FALSE)))
You were probably right with COUNTIF and Indirect. Possibly you struggled with single apostrophes for the name of sheets with spaces. You can try this in B2:
=MAKEARRAY(COUNTA(A2:A),3,LAMBDA(r,c,COUNTIF(INDEX(INDIRECT("'"&INDEX(A2:A,r)&"'!B2:D"),,c),FALSE)))

Unique Filter multiple sheets with ArrayFormula

I have no idea how to title this post, apologize in advance.
I have several sheets with a number in Column I and a name centered and merged in columns A:H. I want to obtain the name from A:H of the corresponding value within I but do have duplicates, therefore I need the nth value when permitted. The formula I have so far works up to the point it does not autofill down as an ArrayFormula, so when I drag the formula down I get an #REF! error due to the fact that when a duplicate is found it cannot overwrite the formula below.
This will be easier to showcase: LINK TO SHEET.
Essentially, in the main sheet all the values in I:I of all the other sheets are obtained and sorted, then using that column I want to return the name that corresponds to the value, allowing for duplicates to work themselves out. I believe my issues resides in the $B1 part at the end of the formula preventing it from being an array.
=ARRAYFORMULA(UNIQUE(FILTER({Sheet2!$A$1:$A;Sheet3!$A$1:$A;Sheet4!$A$1:$A},{Sheet2!$I$1:$I;Sheet3!$I$1:$I;Sheet4!$I$1:$I}=$B1)))
Cell F2 on the Sheet1 tab:
=QUERY({Sheet2!A:I;Sheet3!A:I;Sheet4!A:I},"select Col1,Col9 where Col9>0 order by Col9 asc",0)
You can read more about query here.

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

Total Value based on Group cross reference? (Google Sheets)

I'd like to query a couple of tables to come up with a total sum of the value of a set of items, but with the price being dependent on data in another cell range, then grouping it based on category.
For example, say I have a data table containing name, category, and price of some grocery items. Another table I store my current inventory of groceries. I would like to calculate the value of, say, all my fruit.
Here is an editable example:
https://docs.google.com/spreadsheets/d/1y2fLgwrsMr-dWojy3uYZ1Qs2U01AP3RlT_PI2txwZRE/edit?usp=sharing
Not sure the best way to approach this?
Thanks for any guidance!
Solution
Use VLOOKUP for searching the right item of your inventory and then multiply it with the value of the product you made the search with. For more info about VLOOKUP check this documentation.
=VLOOKUP(E3,$A$3:$C$11,3,FALSE)*F3
With these values, create a column next to Quantity indicating the total price for each product (as show in the picture below). Then, create another column with the Type of each item performing a similar VLOOKUP formula:
=VLOOKUP(E3,$A$3:$C$11,2,FALSE)
Finally, use these two columns as input ranges to apply a SUMIF formula for adding up the items of each group:
=SUMIF(H3:H6,"Fruit",G3:G6)
For more info about SUMIF check this documentation.
I hope this has helped you. Let me know if you need anything else or if you did not understood something. :)

Compare data google sheets

I am using google sheets and I want to compare the quantity of interactions o a given person in a period of time.
My problem is that between one week and another, the people can change, some people can have no interactions and is not reported and I can have new people.
So I need a formula that allow me to compare the previous period of time but also the name.
I am trying this in order to follow up how the people's behavior is changing.
This is the example spreadsheet.
Thanks
This is an easy, quick-and-dirty solution using vlookup.
There are two variations. One using a single criteria and one using multiple criteria. infoinspired.com has a good article on How to Use VLOOKUP with Multiple Criteria in Google Sheets.
Single Criteria: This is the formula.
=iferror(vlookup((B2+1)&C2,$A$2:$D$9,4,false),"error")
This involves a cheat by creating a new column A which contains the concatenation of the date and name values for each row. This is a unique value.
The lookup criteria is the (date (B2) plus 1=the next day) and the name.
The lookup range is self-explanatory and the value returned is the Quantity (from column 4).
The vlookup formula is inside an iferror() so that any problems are highlighted.
Multiple Criteria: This uses an array formula.
=ArrayFormula(iferror(vlookup((B2+1)&C2, {B2:B&C2:C, D2:D}, 2, 0 ), "error"))
The vlookup component is very similar to the "simple" formula. The difference is that each criteria 1:(Date plus 1) and 2:Name are recognised separately, and assigned discrete lookup columns (B and C respectively).
Again, the whole thing is wrapped in an iferror statement to highlight any problems.
This spreadsheet shows the workings:

Resources