Compare two sheets

%3CLINGO-SUB%20id%3D%22lingo-sub-3175943%22%20slang%3D%22en-US%22%3ECompare%20two%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3175943%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20-%20for%20my%20new%20job%20I%20am%20sent%20an%20'absent'%20spreadsheet%20once%20a%20week%20with%20a%20list%20of%20students%20who%20are%20sick%20from%20school.%26nbsp%3B%20It%20comprises%20first%20name%2C%20last%20name%2C%20year%2C%20tutor%20group%2C%20etc.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20separate%20'main'%20sheet%20which%20shows%20every%20student%20in%20the%20school.%26nbsp%3B%20The%20columns%20include%20'full%20name'%2C%20and%20among%20other%20things%20'FSM'%20which%20would%20show%20a%20Y%20or%20N%20to%20indicate%20if%20they%20receive%20free%20school%20meals.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20to%20send%20meal%20vouchers%20to%20students%20who%20are%20absent%20but%20receive%20free%20school%20meals.%26nbsp%3B%20I%20don't%20know%20how%20to%20compare%20the%20two%20sheets%20to%20pull%20up%20the%20answer.%26nbsp%3B%20There%20are%20too%20many%20just%20to%20scroll%20through.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20can%20TEXTJOIN%20so%20that%20the%20'absent'%20sheet%20has%20the%20student%20full%20names%2C%20i.e.%20the%20same%20format%20as%20names%20are%20presented%20in%20my%20'main'%20sheet%2C%20and%20I%20know%20how%20to%20filter%20my%20own%20list%20to%20show%20only%20students%20who%20receive%20school%20meals%20but%20not%20then%20how%20to%20pull%20from%20that%20list%20those%20that%20are%20on%20the%20separate%20'absent'%20sheet.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20prior%20person%20apparently%20did%20this%20with%20a%20Pivot%20table%20but%20I%20don't%20understand%20how%20to%20do%20that.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3175943%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3176178%22%20slang%3D%22en-US%22%3ERe%3A%20Compare%20two%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3176178%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1309520%22%20target%3D%22_blank%22%3E%40RLS_SLR%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DIF(AND(B2%3D%22Y%22%2CNOT(ISNA(VLOOKUP(A2%2Cabsent!%24E%242%3A%24E%2420%2C1%2CFALSE))))%2C%22Absent%20and%20free%20voucher%22%2C%22no%20free%20voucher%22)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CSPAN%3EPerhaps%20this%20can%20be%20done%20with%20above%20formula%20if%20the%20data%20is%20arranged%20as%20in%20the%20attached%20file.%20Enter%20the%20formula%20with%20ctrl%2Bshift%2Benter%20if%20you%20don't%20work%20with%20Office365%20or%202021.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3176179%22%20slang%3D%22en-US%22%3ERe%3A%20Compare%20two%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3176179%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1309520%22%20target%3D%22_blank%22%3E%40RLS_SLR%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DIF(AND(B2%3D%22Y%22%2CNOT(ISNA(VLOOKUP(A2%2Cabsent!%24E%242%3A%24E%2420%2C1%2CFALSE))))%2C%22Absent%20and%20free%20voucher%22%2C%22no%20free%20voucher%22)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EPerhaps%20this%20can%20be%20done%20with%20above%20formula%20if%20the%20data%20is%20arranged%20as%20in%20the%20attached%20file.%20Enter%20the%20formula%20with%20ctrl%2Bshift%2Benter%20if%20you%20don't%20work%20with%20Office365%20or%202021.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi - for my new job I am sent an 'absent' spreadsheet once a week with a list of students who are sick from school.  It comprises first name, last name, year, tutor group, etc.  

 

I have a separate 'main' sheet which shows every student in the school.  The columns include 'full name', and among other things 'FSM' which would show a Y or N to indicate if they receive free school meals.  

 

I need to send meal vouchers to students who are absent but receive free school meals.  I don't know how to compare the two sheets to pull up the answer.  There are too many just to scroll through. 

 

I can TEXTJOIN so that the 'absent' sheet has the student full names, i.e. the same format as names are presented in my 'main' sheet, and I know how to filter my own list to show only students who receive school meals but not then how to pull from that list those that are on the separate 'absent' sheet.  

 

The prior person apparently did this with a Pivot table but I don't understand how to do that.  

 

Thank you

3 Replies

@RLS_SLR 

 

=IF(AND(B2="Y",NOT(ISNA(VLOOKUP(A2,absent!$E$2:$E$20,1,FALSE)))),"Absent and free voucher","no free voucher")

 

Perhaps this can be done with above formula if the data is arranged as in the attached file. Enter the formula with ctrl+shift+enter if you don't work with Office365 or 2021.

@Quadruple_Pawn thank you so much for your assistance and time.  I have been messing about with VLOOKUP - following little online guides for hours to achieve what you have shown on your example but keep failing. I don't know where exactly I am going wrong.  I'm going to continue try and follow your formula through to see what I am messing up.  Again - thank you so much.  

@RLS_SLR 

=IF(NOT(ISNA(INDEX(absent!$E$2:$E$20,MATCH(1,(main!B2="Y")*(main!A2=absent!$E$2:$E$20),0)))),"Absent and free voucher","no free voucher")

You can try INDEX and MATCH as well. Enter the formula with ctrl+shift+enter if you don't work with Office365 or 2021.