COUNTIFS() for non-contiguous range defined as a NAME - countif

I have a spreadsheet that shows the name of attendees to meetings on one tab (e.g. Meeting 1 are columns E:G, Meeting 2 are columns H:J, etc...). Each meeting has the name of the person invited, their team name and then a Yes/No for attendance. The cells with names are assigned a defined name "MeetingAttendees" - and thus are non-contiguous. On a second tab (first tab is labled "POC") I have the unique list of every possible invitee across all of the columns on the other tab (labled "Team Members"). I am trying to create a count to see how many meetings that person has actually attended (not just invited).
MeetingAttendees = "=POCs!$E$10:$E$30,POCs!$H$10:$H$37,POCs!$K$10:$K$42"
AttendeeDisposition = "=POCs!$G$10:$G$30,POCs!$J$10:$J$37,POCs!$M$10:$M$42"
Attempting this formula which doesn't seem to be working (I get "#VALUE!")
=countifs("MeetingAttendees",A2,"AttendeeDisposition","yes")
Joe Smith is a value in A2 and is one of the cells in the MeetingAttendees named range.
Please help.

Related

google sheet script filter and query based on checkbox and date

I have 2 sheets.
1 sheet with 3 columns: 1 column with dates, 1 column with data and one with checkboxes
The other sheet I want to apply the query on
If a checkbox is checked that copy a row with specific column based on the date of 2 cells on the target sheet. (one cell contains month (januari, second cell contains year 2023)
The query part works:
=QUERY(Data!A1:D, "select B,A,C where D=TRUE")
But then howto integrate the date filter. I need some guidance, sometimes I cant get my head around it.
=QUERY(filter(Data!A1:D100, "select B,A,C,D where D=TRUE",TEXT(Data!A1:A100,"yyyMMMM") = $D$1 & $B$1))
Latest code I came up with, but does not work.
Suggestions are welcome
Use filter() with two criteria, like this:
=filter(
{ Data!B1:B, Data!A1:A, Data!C1:C },
Data!D1:D,
text(Data!A1:A, "MMMyyyy") = left(B1, 3) & D1
)
...where column Data!A1:A contains numeric date values, cell B1 contains a month name as a text string and D1 contains a year as a number.

I want to count a range of cells if they contain multiple criteria then return the amount of "yes" to the corresponding criteria

So I have a Column which has multiple texts types in (B1, B2, B3) this corresponds to the group customers are allocated.
Additionally there is another 3 columns which contain yes or blanc cells which tells me if they have received coaching.
I want to filter customers by group and then count how many of them have had coaching.
Im using the following sum to count the group by =SUM(COUNTIFS(E20:E998,{"B1","B2","B3"})) this works and counts the amount of customers i have which are from the B1, B2 or B3 group. But I also want it to count which of these groups have attended coaching which is representative of the text yes in a range of 4 columns.
At the moment I am filtering my tracker to set groups and then using COUNTA acorss the range of 4 columns to get the sum but is there a way to combine COUNTSIFS and COUNTAs so that i can filter customer by group and then count those that have attended coaching ?

How do I create a single bar chart from three independent data sources?

Input
I have three datasets (simplified example below):
List of students from school A and their age (1200 records)
List of students from school B and their age (200 records)
List of students from school C and their age (2000 records)
Every dataset has two columns: studentId and age.
Desired result
I want to create a bar chart that shows the distribution of age across these schools. For easy comparison I would like to have:
one bar chart
with three legend entries:
A
B
C
7 categories:
age =< 12
age = 13
...
age >= 18
What I have tried
I tried linking the datasets, but due to the different number of students and the various studentId formats per school this did not work.
I tried using the studentId columns of the three datasets as the value and the age column of every dataset as the axis. This only worked one dataset at a time. I needed to "Go to the next level in the hierarchy" to see the other dataset.
How else can I achieve this?
You can go into Power Query Editor:
And you will need to add a new column for each datasheet with the legend you want, for example:
So your tables should look like this:
Then merge the tables with Append Queries as New:
Select Three or more tables, and add the three tables:
And there you have your three tables merged into one.

many =if 's to automatically fill in a column

I am in Google Sheets, and I have a column with many choices from a drop down (retail stores, i.e.Home Depot, Walmart) and in another column I want a certain % for tax to get added to the price when the retail store is selected. So in row 2 if I select Walmart in that "retail" column, then in the "tax" column it will automatically insert 9%. When I select Menards from the retail list, in the tax column it would automatically insert 2%. I have 20+ retail stores that I want a certain % automatically inserted into another column. How would I do this?
you may need to add another table with list of all stores and taxes:
Walmart 9%
Menards 2%
Home Depot 3%
... ..
and so on...
Lets call this new table "Store-Taxes". Then just use vlookup formula:
A B
Store Tax
Name1 =ArrayFormula(Vlookup(offset(A2,,,counta(A2:A)), "Store-Taxes", 2, 0))
Name2 ...
Name3 ...
Replace "Store-Taxes" with table's actual reference, like 'Store-Taxes'!A:B. Formula in cell B2 will expand automatically. Look at this example to find out how this technique works.

How do I structure MySQL tables where one field could contain multiple values (but might not)?

I'm designing a web app which allows users to attend events and search for specific types of events.
Say, for instance, that these events are taking place in Hogwarts. The students have their own table where their studentID is held as a primary key, and this also contains which house they are a part of (of which there are 4), the subject they take, and which year of study they are in (e.g. 1 or 4 or 5, etc). The events can be for all students, specifically for 4th year students in the Ravenclaw house, or anywhere in between.
The events are held in an events table, which contains an eventID as the primary key, but I'm not sure how to hold the data for the house/year/subject it is aimed at. Obviously if an event were only aimed at 3rd year Hufflepuffs who take Potions, or something similarly specific, I could hold it within the same table. However, what if the event is for any year of Hufflepuffs (and not any Slytherins, etc)? Or if all students from all years, houses and subjects are eligible to attend? Will I need a table which holds all the years for each event and a separate table for which houses it's for and a further separate table for the subject it's aimed at?
Any advice or links are appreciated.
I think there are two ways but you definitely need at least one more table for the associations. Either you want to be very specific, about the combinations possible or you want to do it generally, like: only third years, only hufflepuffs, then the combination of the two values will be only third year hufflepuffs.
What I am trying to say are these two options.
1) One table that holds rows with very specific details:Event ID and the explicit combinations of all possible options (Here you will have a lot of rows)
This would mean that the event can be associated with second and third year hufflepuffs, but only second year slytherins.
association_id event_id year_id house_id subject_id
1 1 second hufflepuff potions
2 1 third hufflepuff potions
3 1 second slytherin potions
2) One table per property (here the disctinction is not as clear but you only have to create one row per property etc.
The following two tables could be used to store that all hufflepuffs and all slytherins that are in second or third year might attend
association_id event_id year_id
1 1 second
2 1 third
association_id event_id house_id
1 1 hufflepuff
2 1 slytherin
Does that answer your question or at least help you to find a solution?
Mybe if you can describe the target you are aiming at more closely one can find a solution suitable for your Problem together.