Removing Absent People from a List

Brown

Board Regular
Joined
Sep 14, 2009
Messages
224
Office Version
  1. 365
Good morning,
I am trying to wrap my mind around this, and I know someone here can send me in the right direction. I have tried xlookup and if formulas but I am not getting what I need.
I have two lists of students, one list is daily absences and one is After School Club. I need the students on the Absence sheet to be removed from the After School Club sheet. Student ID will be the connection between the two sheets not names. What will be the easiest way to make this happen? I will need to build a sheet to give to a school admin to check this, and recreate daily.

Thank you for your thoughts.
Brown
1740750735155.png
1740750849447.png
 
MrExcelPlayground24.xlsx
ABCDEFGHIJK
1SHEET ABSENCE LISTSHEET CLUB LISTSHEET TODAYS CLUB SHEET
2
3NameGradeIDDateNonsenseIDClubDate2/28/2025
4John1102/27/2025Puke10Checkers
5Mary2112/27/2025Puke10FootballClubStudents Allowed Today
6Sally3122/27/2025Fever11FootballCheckers10, 15, 18
7Fred4132/27/2025Fever12FootballFootball10, 11, 14, 15, 16, 17
8Jamie5142/27/2025Lazy14Football
9Sally3122/28/2025Fever15Checkers
10Fred4132/28/2025Fever15Football
1116Football
1217Football
1318Checkers
Sheet2
Cell Formulas
RangeFormula
J6:J7J6=UNIQUE(Table2[Club])
K6:K7K6=LET(sicktoday,FILTER(Table1[ID],Table1[Date]=$K$3),clubroster,FILTER(Table2[ID],Table2[Club]=J6),ok,FILTER(clubroster,ISNA(XMATCH(clubroster,sicktoday,0))),TEXTJOIN(", ",TRUE,ok))
Dynamic array formulas.
 
Upvote 0
Thank you for that, but is there a way to just remove the absent students from the after school club list? I need to be left with an after school club list of kids present today.
Brown
 
Upvote 0
Hmm, I shouldn't have deleted my response! If you can use code, it should be doable. What's the goal - removing the values only or removing the whole row? If row, it will likely mess up your alternate row colour. You could manually fix it, or additional code should be able to fix it.
 
Upvote 0
Hmm, I shouldn't have deleted my response! If you can use code, it should be doable. What's the goal - removing the values only or removing the whole row? If row, it will likely mess up your alternate row colour. You could manually fix it, or additional code should be able to fix it.
I am afraid code would make this more difficult for the person requesting this. What I would ultimately like to have is a list of students on the After School Club sheet that are present that day.
I was able to get this xlookup to return a student from the absent sheet in column D. This just places the absent students in column D, it doesnt leave me with a list of present students.
Thanks
Brown
1740758087808.png
 
Upvote 0
MrExcelPlayground24.xlsx
ABCDEFGHIJK
1SHEET ABSENCE LISTSHEET CLUB LISTSHEET TODAYS CLUB SHEET
2
3NameGradeIDDateNonsenseIDDate2/27/2025
4John1102/27/2025Puke10
5Mary2112/27/2025Puke11People who can't clubPeople who can club
6Sally3122/27/2025Fever121015
7Fred4132/27/2025Fever141116
8Jamie5142/27/2025Lazy151217
9Sally3122/28/2025Fever161418
10Fred4132/28/2025Fever17
1118
12
Sheet2
Cell Formulas
RangeFormula
J6:J9J6=LET(sicktoday,FILTER(Table1[ID],Table1[Date]=$K$3),clubroster,Table24[ID],ok,FILTER(clubroster,ISNUMBER(XMATCH(clubroster,sicktoday,0))),ok)
K6:K9K6=LET(sicktoday,FILTER(Table1[ID],Table1[Date]=$K$3),clubroster,Table24[ID],ok,FILTER(clubroster,ISNA(XMATCH(clubroster,sicktoday,0))),ok)
Dynamic array formulas.
 
Upvote 0
OK. I'm not a formula guy so can't help there. Not sure why running code would be difficult but if you change your mind, this seems to work.
VBA Code:
Sub RemoveAbsent()
Dim ws As Worksheet
Dim rng As Range
Dim lrow As Long, i As Integer
Dim IDtoFind As Variant

lrow = Sheets("Sheet9").Cells(Rows.Count, "A").End(xlUp).row 'absence sheet
Set ws = Sheets("Sheet3") 'attendance sheet
For i = 2 To lrow
    IDtoFind = Range("C" & i)
    Set rng = ws.Cells.Find(What:=IDtoFind, After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, _
    SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
    If Not rng Is Nothing Then rng.EntireRow.ClearContents
Next

End Sub
ABSCENCE
1740760396708.png
CLUBS BEFORE
1740760479541.png
CLUBS AFTER
1740760512032.png
 
Upvote 0
OK. I'm not a formula guy so can't help there. Not sure why running code would be difficult but if you change your mind, this seems to work.
VBA Code:
Sub RemoveAbsent()
Dim ws As Worksheet
Dim rng As Range
Dim lrow As Long, i As Integer
Dim IDtoFind As Variant

lrow = Sheets("Sheet9").Cells(Rows.Count, "A").End(xlUp).row 'absence sheet
Set ws = Sheets("Sheet3") 'attendance sheet
For i = 2 To lrow
    IDtoFind = Range("C" & i)
    Set rng = ws.Cells.Find(What:=IDtoFind, After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, _
    SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
    If Not rng Is Nothing Then rng.EntireRow.ClearContents
Next

End Sub
ABSCENCE
View attachment 122826 CLUBS BEFORE View attachment 122827 CLUBS AFTER View attachment 122828
Thank you. It is not me that I am worried about it is the person requesting this. I need to find a way that the beginner level Excel user can quickly, within 10-15 minutes, create a list of students that are present for the after school clubs each day.
I appreciate your time and effort, and teaching me a little more about Excel.
Brown
 
Upvote 0
Not sure if this is what you're looking for, but you could add a filter rather than deleting the rows.

EMT1844-Part02.xlsx
ABCDEFGHI
1AbsencesAfter School ClubAfter School Club minus Absences
2
3Student NamePerm IDStudent IDGrade LevelStudent IDGrade Level
4Jeff14249401413847313216114
5Max14491961402175313544245
6Dave14481691321611413718436
7Rich140217513544245
8Kevin141384713718436
914491961
1014481692
Imported Text Files
Cell Formulas
RangeFormula
G4:H6G4=FILTER(D4:E10,ISNA(MATCH(D4:D10,B4:B8,0)))
Dynamic array formulas.
 
Upvote 0
Thank you. It is not me that I am worried about it is the person requesting this. I need to find a way that the beginner level Excel user can quickly, within 10-15 minutes, create a list of students that are present for the after school clubs each day.
I appreciate your time and effort, and teaching me a little more about Excel.
Brown
This shouldn't be an issue as long as you can set up the macro yourself. Once you enter the code provided, you can assign it to a button on the worksheet. All the user would then have to do it is click on the button for the code to run.
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top