Look for multiple occurences of text (partial match) - excel

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.

Related

Extract list in excel based on criteria

I have a list of names and a list of categories in a table.
Example:
Name Category 1 Category 2 Category 3
Jane Doe X X
Bill Smith X X
Eric Hamilton X
From that list, I want to list the people for each category.
Example:
Category 1 Category 2 Category 3
Jane Doe Jane Doe Bill Smith
Bill Smith Eric Hamilton
Is there a way I can do this in excel?
I found this video which seems to accomplish what I want. The formula is a bit more complicated than what I was hoping for, but it worked. I just removed some of the absolute cell references and copied the formula for the number of categories I currently have and it grouped the users properly.
https://www.youtube.com/watch?v=QkHfZtvC7UQ

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 ...

concatenating two part-words together

I am helping someone with their wedding and i am using excel for the table plans for their dinner.
When i originally set this up, i was stupid enough to make two people, not as a couple, but as individual people.
So i have mr person and mrs person.
Now i want to make these two individuals into one cell row in excel.
i.e. before; | mr person | 72 land lane | 1234-5678.
And mrs person | 72 land lane | 1234-5678.
How would i make it so that it would be | mr & mrs person | 72 land lane | 1234-5678 | ?
P.s. some people on the list are singles! so i cant find and replace, to add a mrs part to each person!
Assuming your name, address and phone number are in different columns I'd use a COUNTIF statement in Column D to identify those at the same address (assuming they all live together!) You'll need to adjust the range, and insert a blank column into Column A.
=IF(COUNTIF($C$2:$C$9,C2)>1,"Mr & "& C2,"")
This will concatenate all the couples, you can then use the below formula in a different column to identify the partner to be deleted:
=IF(LEFT(C2,8)="Mr & Mr ","DELETE","")

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.

Excel - Counting unique records in a group

I'm having difficulty counting records in a file that have a unique ID and listing the number of rows associated with that specific ID.
For this file, the unique ID represents a specific family (column A). Each member of the family is in a different row with the same ID. I would like to count the number of family members(rows) in each unique family. I can have a few thousand rows so automating this would be wonderful. Thanks for any help!!
You can do this now automatically with Excel 2013.
If you have that version, then select your data to create a pivot table, and when you create your table, make sure the option 'Add this data to the Data Model' tickbox is check (see below).
Then, when your pivot table opens, create your rows, columns and values normally. Then click the field you want to calculate the distinct count of and edit the Field Value Settings:
Finally, scroll down to the very last option and choose 'Distinct Count.'
This should update your pivot table values to show the data you're looking for.
So if I'm understanding you correctly, you have something like
A B C
Fam. ID LastName FirstName
1 Smith John
1 Smith Mary
1 Smith Johnnie Jr
2 Roe Rick
3 Doe Jane
3 Doe Sam
and you want a new column (say, D), with a count of members per family:
A B C D
Fam. ID LastName FirstName Fam. Cnt
1 Smith John 3
1 Smith Mary 3
1 Smith Johnnie Jr 3
2 Roe Rick 1
3 Doe Jane 2
3 Doe Sam 2
This will do it -- insert at D2 and drag down:
=COUNTIF(A:A,A2)

Resources