Lookup values based on third colum in Sharepoint lists - sharepoint

I have a sharepoint list A:
Person | Job
John Blue Collar
Billy White Collar
Tracy CEO
Where A.Job is a lookup column getting options from list B:
Job Title | Job Status
Blue Collar Open
White Collar Open
CEO Closed
I want A.Job to only show options from B.Job Title WHERE B.Job Status is 'Open'
Is it possible to do this in SP?

You could create a calculated column in list B, and choose whether to use the value of Job Title according to the status.
Formula:=IF([Job Status]="open",[Job Title],"")
Then list B get the value from the calculated column.

Related

GSuite App Maker - how to pivot datasources

I have a simple app that takes attendance for a list of students. There are two datasources, a students table with first name, last name, id, and site, and an attendance table with first name, last name, date and present.
I want to be able to log attendance by getting a list of the students, entering a date, and check a box if they're in attendance or not (boolean column).
What I would like to do is pivot the attendance date for a new view so that instead of having a column with distinct dates, I'll have a columns for each date showing the value of the checkbox.
Ex:
Attendance 1:
First Last Date Present
Bob Smith 10/1 0
Bob Smith 10/2 1
Bob Smith 10/3 1
Kevin Brown 10/1 1
Kevin Brown 10/2 1
Kevin Brown 10/3 1
New Pivoted View:
First Last 10/1 10/2 10/3
Bob Smith 0 1 1
Kevin Brown 1 1 1
Is there a simple way to get this result in App Maker?
EDIT: For clarification. The primary purpose of the app is to capture attendance data in a classroom setting. So there is a flow where a teacher pre-populates a list of students and then checks the boxes down the line to log where a student was present/absent.
What I would like to be able to do is provide a page that presents the attendance data in a wide format so teachers can also look across the columns to see who was there on a given day.

Dropwdown list from dynamic table

I have a dynamic table containing the following columns:
COUNTRY(String), ACTIVE (Boolean),NAME(String)
An example will be:
COUNTRY(String), ACTIVE (Boolean),NAME(String)
USA, True, Chair
Canada, False, Table
USA, False, Pen
USA, True, Pencil
Canada, True, Pencil
Canada, True, Basket
I want to create a data validation list with the names for every country that are active. The list should be dynamic as the table is constantly being changed.
For the example, the data validation list should check whether the cell containing the country name is Canada or USA and
if USA then: Chair, Pencil / if Canada: Pencil, Basket.
I have resolved this using a three-step organization. The first step is to make a "table" for any growing/shrinking list that will be used for the data validation.
Step 1
List the possible values in columns as a new table. Place the country name at the header row for each column.
A B C D E
1 Country chair USA Canada <----header row
2 USA pencil pencil table
3 Canada table Plato warthog
4 USA warthog
5 Canada tuba
6 USA magic
7 Canada Plato
Select the columns (for instance, D1:E3 in the example) and click Insert > Table.
Check "my data has headers" and click OK.
Select a cell in the newly-formatted column and click Table Tools > Design > Properties > Table Name: ______ and type Countries.
Step 2
Select the column for which you want data validation. Note which cell is active (the cell inside of the selection which you can write to). In the example, it's Cell B2.
Step 3
Under data validation, choose list and type in this equation:
=INDIRECT("Countries[" & A2 & "]")
If the row that's active is row 3, type this in instead:
=INDIRECT("Countries[" & A3 & "]")
This is actually working for me. Try it!

Total points for each student in Google spreadsheet or excel

I am in the process of creating a Google form, which students will fill out after attending an event. Based on the event they attend, I will be assigning points to them and this form can be submitted through the whole year.
Is there a way to get a total number of points for each students, since they'll be submitting the form multiple times, I need a way to tally up the points for each students
Example spreadsheet goo.gl/1aunYg
Sam | 2
Jon | 2
Mike | 2
Don | 2
Sam | 3
Sam | 1
Jon | 2
Mike | 1
Total for Sam: ???
Total for Jon: ???
Total for Mike: ???
Total for Don: ???
In google spreadsheets, assuming you have the names in Col A and the scores in Col B, you can also try:
=query(A2:B; "select A, sum(B) where A <>'' group by A label sum(B) 'Totals' ")
This should output an array of unique names and the summed scores.
Sort the list on Name (Home>Sort & Filter)
Add a heading for the columns
Apply SubTotals (Data>Subtotal in the Outline group) at each change in Name and using the function Sum.
You can then hide/show individuals using the controls on the LH side.
Google Spreadsheet see SUMIF
In Excel you could do something like ...

Look for multiple occurences of text (partial match)

I am struggling to solve the below problem:
I have a list of users who have attended various numbers of courses. Now I want to find which courses each person has attended and list them in a new sheet. Below is a picture of my sheet:
Names | Courses
--------------------------------------------------------------------------------------
Farnaz Hossein Zadeh, Elena Pak, Mehran Behzadi, Atefeh Ghorbani, John Smith | AP01
John Smith, Farnaz Hossein Zadeh, Tom green | AP03
John Smith | AP05
And I need to get:
F G H
Farnaz Hossein Zadeh AP01 AP03
As far as I know, this is not quite possible with Excel formulas alone.
First, you need to clean up your data. Your can use Data > Text to columns to separate the comma-separated data. Then, make that data vertical so that you effectively have a list of pairs course-student. Then you can list unique courses by doing a pivot table on your data.

Report generation based on multi lookup and dynamic columns

I am a little stuck with a report I am trying to generate in Excel and was hoping someone could help.
Here is a summary of what I am trying to do:
Table 1 has one column called people (it’s basically a list of
employees)
Table 2 has one column called countries (it’s basically a
list of relevant countries)
Table 3 has three columns called person,
country and date.
There is one entry for every person each time they review a country.
So the data will look something like:
PERSON | COUNTRY | DATE
John | uk | 10/01/2013
Paul | uk | 15/01/2013
John | France | 15/01/2013
Bob | Spain | 16/01/2013
The report I need to produce is one which shows who has/hasn't checked each country.
So the columns will be ‘Person’, uk, France, Spain (and any other unique value from the country table).
There will then be one single row for each person with a Yes/No value in the relevant column if that person has reviewed that country i.e. Table 3 contains a value that matches that value for the person and country.
So to be clear the report should be similar to:
PERSON | UK | FRANCE | SPAIN
John | Yes | Yes | No
Paul | Yes | No | No
Bob | No | No | Yes
In summary I can split this into two problems:
How to generate a table that has a column for every unique value in another table (country in the explanation above)
How to do a double lookup i.e. IF EXISTS in TABLE 3 ‘person’=john & ‘country’=uk then return ‘Yes’, otherwise return ‘No’
I’m happy to keep in Excel or make use of SQL reporting i.e move my data to SQL first.
It's kind of a wonky formula but =sumproduct() will do a dual lookup.
=IF(SUMPRODUCT(--($K$2:$K$5=$K13), --($L$2:$L$5=M$10)),"Yes","No")
The Person/Country/Date table is located in the range K1:M5 the results table is located in range K10:N13. I had a workbook open and put it in the corner. (Nobody puts sumproduct in the corner)
The gist is, -- turns a true and false into a 1 or 0. sumproduct will multiply the two results line by line. If both are true, you get 1 x 1 and funnels that back into the if for a yes and no. You'll have to be mindful of th $ in the formula.

Resources