Pulling data from one tab to another- with an editable parameter

%3CLINGO-SUB%20id%3D%22lingo-sub-1752533%22%20slang%3D%22en-US%22%3EPulling%20data%20from%20one%20tab%20to%20another-%20with%20an%20editable%20parameter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1752533%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20organising%20a%20school%20timetable%20on%20excel.%26nbsp%3B%20Days%20of%20the%20week%20are%20on%20tabs.%26nbsp%3B%20With%20classes%20on%20columns.%26nbsp%3B%20Lessons%20in%20rows.%26nbsp%3B%20Each%20cell%26nbsp%3B%20has%20data%20entered%20like%20this%20%3CSTRONG%3E1A%2FEng%2FCMC%3C%2FSTRONG%3E%26nbsp%3B%20(class%20code%2FSubject%2FTeacher%20code)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20create%20an%20additional%20tab%20where%20I%20can%20generate%20a%20full%20week%20timetable%20for%20a%20teacher%20or%20a%20class%20but%20pulling%20the%20data%20from%20the%205%20daily%20tabs%20(Im%20aware%20it%20will%20be%20slightly%20different%20lookup%20formula%20for%20each%20tab)%20but%20is%20there%20a%20way%20I%20can%20make%20find%20all%20the%20times%20CMC%20shows%20up%20for%20example%3F%26nbsp%3B%20Or%20adjust%20it%20so%20it%20finds%20all%20of%20the%201A%20sessions%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3ECan%20someone%20help%20with%20the%20formula%20for%20the%20pulling%20data%20into%20the%20weekly%20tab%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThen%20supplementary%20to%20that%20is%20there%20a%20way%20I%20can%20build%20in%20a%20'search'%20box%20into%20the%20weekly%20timetable%20generator%20tab-%20so%20someone%20types%202D%20into%20a%20box%20and%20the%20full%20weekly%20timetable%20for%20class%202D%20shows%3F%20Or%20they%20can%20type%20their%20teacher%20code%20like%20TTA%20into%20the%20box%20and%20the%20teacher%20gets%20her%20timetable%3F%26nbsp%3B%20I%20have%20seen%20this%20on%20other%20sheets%20(not%20for%20this%20purpose%20but%20I%20have%20seen%20it)%20and%20I%20need%20teachers%20to%20be%20able%20to%20see%20their%20own%20timetables%20in%20a%20week%20view.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1752533%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1752550%22%20slang%3D%22en-US%22%3ERe%3A%20Pulling%20data%20from%20one%20tab%20to%20another-%20with%20an%20editable%20parameter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1752550%22%20slang%3D%22en-US%22%3EFor%20better%20understanding%2C%2C%2C%20please%20share%20some%20sample%20data%2FWorkbook%20along%20with%20expected%20output%20then%20I'll%20show%20you%20the%20method%20to%20achieve%20the%20goal!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1752614%22%20slang%3D%22en-US%22%3ERe%3A%20Pulling%20data%20from%20one%20tab%20to%20another-%20with%20an%20editable%20parameter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1752614%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F93699%22%20target%3D%22_blank%22%3E%40Rajesh-S%3C%2FA%3E%26nbsp%3B%20%26nbsp%3BOk-%20Ive%20added%20some%20images%20of%20current%20and%20goal.%26nbsp%3B%20Hope%20that%20helps!%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1753190%22%20slang%3D%22en-US%22%3ERe%3A%20Pulling%20data%20from%20one%20tab%20to%20another-%20with%20an%20editable%20parameter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1753190%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F822934%22%20target%3D%22_blank%22%3E%40TMcIlroy%3C%2FA%3E%26nbsp%3B%2C%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3EThis%20solves%20the%20issue%3A%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Rajesh-S_2-1602063888052.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F224760iB708DA9F4EDD36F4%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22Rajesh-S_2-1602063888052.png%22%20alt%3D%22Rajesh-S_2-1602063888052.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EResults%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Rajesh-S_0-1602063773091.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F224758i1339FA3FBF4106B1%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22Rajesh-S_0-1602063773091.png%22%20alt%3D%22Rajesh-S_0-1602063773091.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EHow%20it%20works%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CUL%3E%3CLI%3EIn%20Master%20sheet%20from%20B5%20to%20next%20the%20Column%20Name%20must%20similar%20to%20Sheet%20Name%20like%20Monday%2C%20Tuesday.%3C%2FLI%3E%3CLI%3EArray%20(CSE)%20formula%20in%20Master%20Sheet's%20cell%26nbsp%3BB6%3A%3C%2FLI%3E%3C%2FUL%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%7B%3DIFERROR(INDEX(INDIRECT(B%245%26amp%3B%22!%24B%242%3A%24B%248%22)%2CSMALL(IF(COUNTIF(INDIRECT(B%245%26amp%3B%22!%24B%242%3A%24B%248%22)%2C%22*%22%26amp%3B%24C%241%26amp%3B%22*%22)%2CROW(INDIRECT(B%245%26amp%3B%22!%24B%242%3A%24C%248%22))-MIN(ROW(INDIRECT(B%245%26amp%3B%22!%24B%242%3A%24C%248%22)))%2B1)%2CROW(%24A1))%2CCOLUMN(%24A1))%2C%22%22)%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3EFinish%20formula%20with%20%3CSTRONG%3ECtrl%2BShift%2BEnter%2C%26nbsp%3B%3C%2FSTRONG%3Eand%20fill%20across.%3C%2FLI%3E%3CLI%3ENext%20you%20need%20to%20adjust%20cell%20references%20in%20this%20part%2C%20before%20you%20change%20the%20criteria%20in%20cell%20C1.%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CEM%3EFor%20GDA%20change%20this%20%3A%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EINDEX(INDIRECT(B%245%26amp%3B%22!%24C%242%3A%24C%248%22)%2CSMALL(IF(COUNTIF(INDIRECT(B%245%26amp%3B%22!%24C%242%3A%24C%248%22)%2C%22*%22%26amp%3B%24C%241%26amp%3B%22*%22)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESince%20GDA%20records%20are%20in%20Column%20C.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3EYou%20may%20use%20IF%20to%20check%20criteria%20in%20cell%20C1%2C%20and%20accordingly%20for%20TRUE%20and%20FALSE%20use%20required%20data%20range%20but%20it%20will%20be%20complicated%2C%20so%20better%20adjust%20cell%20references%20as%20I've%20suggested%20above%20%2C%20every%20time%20you%20change%20criteria.%3C%2FEM%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1753646%22%20slang%3D%22en-US%22%3ERe%3A%20Pulling%20data%20from%20one%20tab%20to%20another-%20with%20an%20editable%20parameter%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1753646%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F822934%22%20target%3D%22_blank%22%3E%40TMcIlroy%3C%2FA%3E%26nbsp%3BMerely%20to%20demonstrate%20what's%20possible%20with%20Power%20Query%20(PQ)%2C%20even%20though%20I%20don't%20consider%20myself%20an%20expert%20in%20that%20area%20yet.%20Have%20a%20look%20at%20the%20attached%20workbook.%20I%20mocked-up%20a%20schedule%20for%20one%20week%20and%20introduced%20some%20extra%20classes.%20By%20combining%20structured%20tables%20and%20PQ%2C%20this%20becomes%20totally%20flexible%20and%20dynamic%2C%20without%20the%20need%20for%20complicated%20formulae.%20Expand%20the%20daily%20tables%20downwards%20or%20towards%20the%20right%20and%20all%20should%20update%20automatically.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOnce%20you%20understand%20the%20mechanics%2C%20it's%20quite%20easy%20to%20maintain.%20Though%2C%20you%20would%20have%20to%20invest%20some%20time%20in%20learning%20PQ.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20attached%20example%2C%20go%20to%20the%20%22TeacherSchedule%22%20sheet%2C%20select%20a%20teacher%20code%20in%20B2.%20Then%2C%20on%20the%20Data%20ribbon%20press%20%22Refresh%20All%22%20(can%20also%20be%20automated)%20and%20the%20table%20gets%20updated%20almost%20instantly.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENote%3A%20The%20sheet%20%22DayPlan%20and%20Teachers%22%20contains%20a%20list%20of%20time%20slots%20(from%207%3A30%20-%2016%3A00)%20and%20a%20list%20of%20teacher%20codes.%20Adjust%20these%20to%20suit%20your%20actual%20situation.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hello, 

I am organising a school timetable on excel.  Days of the week are on tabs.  With classes on columns.  Lessons in rows.  Each cell  has data entered like this 1A/Eng/CMC  (class code/Subject/Teacher code)

TMcIlroy_0-1602055199519.png

I want to create an additional tab where I can generate a full week timetable for a teacher or a class but pulling the data from the 5 daily tabs (Im aware it will be slightly different lookup formula for each tab) but is there a way I can make find all the times CMC shows up for example?  Or adjust it so it finds all of the 1A sessions?

TMcIlroy_2-1602055316733.png

Can someone help with the formula for the pulling data into the weekly tab? 

 

Is there a way I can build in a 'search' box into the weekly timetable generator tab- so someone types a class code, or a teacher code the full weekly timetable for that class or that teacher shows up? Or they can type their teacher code like CMC into the box and the teacher gets her timetable?  I have seen this type of thing on other sheets (not for this purpose but I have seen it) and I really need teachers to be able to see their own timetables in a week view and to not have to make 63 of them manually!

 

Thank you!

 

4 Replies
For better understanding,,, please share some sample data/Workbook along with expected output then I'll show you the method to achieve the goal!
Highlighted

@Rajesh-S   Ok- Ive added some images of current and goal.  Hope that helps! 

Highlighted

@TMcIlroy ,,

 

This solves the issue:

 

Rajesh-S_2-1602063888052.png

 

Results:

Rajesh-S_0-1602063773091.png

 

How it works:

  • In Master sheet from B5 to next the Column Name must similar to Sheet Name like Monday, Tuesday.
  • Array (CSE) formula in Master Sheet's cell B6:
{=IFERROR(INDEX(INDIRECT(B$5&"!$B$2:$B$8"),SMALL(IF(COUNTIF(INDIRECT(B$5&"!$B$2:$B$8"),"*"&$C$1&"*"),ROW(INDIRECT(B$5&"!$B$2:$C$8"))-MIN(ROW(INDIRECT(B$5&"!$B$2:$C$8")))+1),ROW($A1)),COLUMN($A1)),"")}

 

  • Finish formula with Ctrl+Shift+Enter, and fill across.
  • Next you need to adjust cell references in this part, before you change the criteria in cell C1.

For GDA change this :

 

INDEX(INDIRECT(B$5&"!$C$2:$C$8"),SMALL(IF(COUNTIF(INDIRECT(B$5&"!$C$2:$C$8"),"*"&$C$1&"*")

 

Since GDA records are in Column C.

 

You may use IF to check criteria in cell C1, and accordingly for TRUE and FALSE use required data range but it will be complicated, so better adjust cell references as I've suggested above , every time you change criteria.

Highlighted

@TMcIlroy Merely to demonstrate what's possible with Power Query (PQ), even though I don't consider myself an expert in that area yet. Have a look at the attached workbook. I mocked-up a schedule for one week and introduced some extra classes. By combining structured tables and PQ, this becomes totally flexible and dynamic, without the need for complicated formulae. Expand the daily tables downwards or towards the right and all should update automatically.

 

Once you understand the mechanics, it's quite easy to maintain. Though, you would have to invest some time in learning PQ.

 

In the attached example, go to the "TeacherSchedule" sheet, select a teacher code in B2. Then, on the Data ribbon press "Refresh All" (can also be automated) and the table gets updated almost instantly.

 

Note: The sheet "DayPlan and Teachers" contains a list of time slots (from 7:30 - 16:00) and a list of teacher codes. Adjust these to suit your actual situation.