I am trying to do the following.
I have 10 sheets labeled Teacher1 through Teacher 10 and an 11th sheet named StudentRoster.
In the StudentRoster sheet I have a list of 100 students names. StudentA, StudentB, StudentC, etc..
In each of the sheets Teacher1, Teacher2, Teacher3, etc. I have about 20 cells in column A that use some of the names listed within StudentRoster (these would be class rosters)
In each of the Teacher1, Teacher2, etc sheets column A will have the student names and column B will be a column in which I will manually insert an "X" to indicate completion of an assignment. Within the StudentRoster sheet I would like to have excel search through Teacher1, Teacher2, Teacher3, ... Teacher10 and count how many "X"s exist for StudentA. Student A may or many not be in all Teacher sheets
Can someone provide me with a way of doing this, I have been trying to use the COUNTIFS formula but I am struggling having it look for StudentA and then to begin counting only the "X"s for StudentA.
List your worksheets on the 11th sheet and name the range sheets then you can use this formula:
=SUMPRODUCT(COUNTIFS(INDIRECT("'"&Sheets&"'!A:A"),A1,INDIRECT("'"&Sheets&"'!B:B"),"X"))
Easiest would be to add a column to each teacher sheet to the left of the studentname. In that column you put in =COUNTIF(range;"X"). Fill in relevant range e.g. C1:K1.
In the student roster list you could use add a top row with the teacher names and sum. With sumif(range of student names in Teacher 1 sheet; select cell with student name in roster; range in teacher 1 sheet with countif outcomes)
Then sum over all sumif statements by student for the total.
There would be other methods, but this one is least complicated and straightforward I think.
Related
I'm trying to achieve the following in Excel: I have two worksheets with details of students and their marks for three different subjects.
Worksheet 1 has a Student Name column with names of all students in the class and a Subject column that tells which subject they have scored the least in.
Worksheet 2 has the same Student Name column but the rows may not be in the same order. Worksheet 2 has three more columns named English, Maths and Science populated with the marks scored by the students.
The Subject column for each student in Worksheet 1 should look up the Student Name column in Worksheet 2 for the corresponding student name and then from that row identify the lowest value and return the subject name (which is the first value in the column/table header of the lowest value). I was thinking of using the VLOOKUP function but I'm not sure how I can nest another function within it to search for the lowest value in the row and return the subject name/table header value.
You can use this formula:
• Formula used in cell B2
=LET(_marks,INDEX($E$2:$G$10,MATCH($A2,$D$2:$D$10,0),0),
FILTER($E$1:$G$1,MIN(_marks)=_marks))
Edit:
When a student scores same minimum marks for two subjects. Then we can use as below to return both the subjects,
• Formula used in cell B2
=LET(_marks,INDEX($E$2:$G$10,MATCH($A2,$D$2:$D$10,0),0),
ARRAYTOTEXT(FILTER($E$1:$G$1,MIN(_marks)=_marks)))
Scenario:
One workbook
Sheet1 contains and employee name and an employee number
Sheet2 contains a variation of the employee name (so and exact match is not possible)
Sheet3 needs to contain the employee number from sheet1 based upon the match of the employee name on Sheet1 with that of Sheet2 to provide the corresponding employee number
I may have to split the three sheets into three separate workbooks, but not sure yet.
I have considered variations of INDEX and MATCH statements and VLOOKUP, but have not been able to return the value desired.
So here is my scenario, I already have a sub that extracts unique names and unique dates from Sheet 1 into Sheet 2 creating the layout of unique names as rows and dates as headers. In Sheet 1 is the master data. For each day of the month, there are different work shifts for the same person. For example...
D Gray worked 3 different shifts on 6/26 so i need the values in Hours summed and then populated into Sheet 2 under the respective 6/26 date and so on and so forth for the other crew members. The template so far is..
Result of New Code
I can't see the image, but I understand your concept so hopefully you can apply the below to your case and use this as your answer.
Say the data in Sheet1 is columned as Date, Name, & Hours worked for A,B, & C respectively (for only 100 rows), your SUMIFS function in sheet2 should be as follows:
=SUMIFS(Sheet1!$C$1:$C$100,Sheet1!$A$1:$A$100,B$2,Sheet1!$B$1:$B$100,$A2)
This as you drag it down will hold the first column in sheet2, the names, and the first row in sheet2 the dates, summing up all the hours worked for all the days of the month.
If you use table formatting you can simply this further and the formula will resize with the table since it would use named ranges. I can help you with that as well if you'd like.
To have VBA add this formula to your spreadsheet use the following:
Dim RangeFormula As Range
Set RangeFormula = Sheet("Sheet2").Range( [input cell range here])
RangeFormula.Formula ="=SUMIFS(Sheet1!$C$1:$C$100,Sheet1!$A$1:$A$100,B$2,Sheet1!$B$1:$B$100,$A2)
You can change the name from RangeFormula to whatever suits better, you can put the sheet name where Sheet2 is but make sure you put the cell range in the range part with " surrounding it. To reference this as a table you'll need to use the ListObjects("Table Name")
I have a workbook that has a separate sheet that is assigned to each classroom teacher. In the column A of each sheet I have the student's names from their rosters listed, in column B I have it set up for them to place an "x" for each incomplete assignment for these particular students. Under my Roster sheet I want the workbook to search through each of the 30+ teacher sheets and find the names of each student and calculate the number of "x's" by their name throughout the sheets and report that info in my "Roster" sheet. Essentially counting how many incomplete assignments each student has throughout. This is the formula that I have on my Roster sheet: =SUMPRODUCT(COUNTIFS(INDIRECT("'"&Sheetss&"'!A:A"),A2,INDIRECT("'"&Sheetss&"'!B:B"),"x"))
"Sheetss" is the range that I have defined for all of my teacher sheets.
My issue with this is that inside my first teacher sheet I can type a student's name (StudentB) in column A and an x in column B, it will return a 1 for StudentB on my Roster sheet, however, when typing StudentB on any other sheet and an x in column B on any other sheet it will not count that data and show a 2, 3, etc.
I feel as though the formula is not searching all of my sheets for data any help would be great. Thanks!!
I have a massive excel document with multiple sheets I need help importing data with from one sheet to another.
In sheet 1 there is a list of entities and what the affiliation's of those entities are. On sheet 2 there is the same list of entities and column name describing each affliction. My goal is to have a formula which looks at each affiliation's and marks a Yes where the Colum name representing the affliction is.
An example of what I mean is:
There is one sheet (sheet 1) which has a column named "Student", and another column next to it named "Favorite color" there are about 4000 (rows) student's information. Some students might have more then one favorite color, but in that case there are 2 entries of the student in the sheet. On another sheet(sheet 2) there is the same column "Student" but there are several columns with each color of the rainbow (Red, Blue, Green etc) these columns have to be marked with a yes or a no. I need to read back into sheet 1 and mark a yes on the 2nd sheet depending on the color described on sheet one.
A VLOOKUP will not suffice when the student can have two "favourite colours". Instead, assuming the same sheet format as #Nelly27281, you can use a COUNTIFS in the following way:
=IF(COUNTIFS(Sheet1!$A:$A,$A2,Sheet1!$B:$B,B$1)>0,"YES","NO")
This counts the number of instances in Sheet1 where Column A contains the student and Column B contains the colour. If it's greater than 0, we associate the student with the colour.
EDIT: sorry, I've assumed here that Column A of Sheet2 contains a list of the students without any duplicates.
Here is the formula that you can use. Place the formula in cell B2 and drag it across the columns and rows that you want to cover:
=IF(VLOOKUP($A2,Sheet1!$A:$B,2,FALSE)=B$1,"YES","")
Assuming your data are presented like: