May 26 2022 04:29 PM - edited May 27 2022 03:56 PM
I have NFL Yearly schedule and have teams worksheet to put teams schedule from Yearly Schedule worksheet.
The picture of 49ers team schedule 2021 is it should look like after I press button that is on is called Buttons worksheets
all the teams worksheet schedule will go into D15:E32 cells
I need help put code for all 32 teams schedules in each worksheets
Thanks You
for any help in advance
SF49ers164480
May 26 2022 05:10 PM
I suggest you can do this using cell formulas and do it with a single lookup sheet. In the attached I used a FILTER() function (requires Excel 365) and a drop down at the top to dynamically select which team to show.
May 27 2022 09:04 AM
May 27 2022 09:41 AM
@sf49ers19238597 I copied the formula to everyone of your tabs ...
May 27 2022 03:58 PM - edited May 27 2022 03:59 PM
I saw problem on your file there is no BYE on the list
Thanks You
May 27 2022 07:40 PM
@sf49ers19238597 good catch. let's try again.
May 28 2022 03:24 PM
May 28 2022 05:37 PM
@sf49ers19238597 I think you want to know how the formula works:
=LET(l,SUBSTITUTE(
FILTER(FullSchedule[WEEK]&" "
&FullSchedule[ROAD TEAM]&FullSchedule[HOME TEAM],
(FulSchedule[ROAD TEAM]=$A$2)
+(FullSchedule[HOME TEAM]=$A$2))
,$A$2,""),
w,TRIM(LEFT(l,3)),
t,TRIM(MID(l,3,99)),
f,XLOOKUP(SEQUENCE(18),--w,t,"BYE WEEK"),
f)
So line 1 sets up the LET() statement and 1st variable "l" Uses FILTER to create a list of rows that has this sheet's Team Name (cell A2). The list is in the format of [Week#]____[HomeTeam][RoadTeam]. So when the SUBSTITUTE replaces the [HOME TEAM] name with blank ("") it leaves a list of [Week#]____[OtherTeam]
Line 7 creates a variable "w" and strips the week#s from the list created in "l". It simply takes the first 3 (LEFT) characters and then TRIMs off any extra space.
Line 8 creates "t" similar to the week number but strips off the Opponent's team name
Line 9 creates "f" which does a lookup of every week number (1-18) in the list of week numbers "w" and returns the corresponding opponent's team name ("t") and for week number(s) that don't exist it returns "BYE WEEK".
Line 10 just say to return "f" as the final list
The Home/Away list:
=LET(li,FILTER('YEARLY SCHEDULE'!A1:B273,
('YEARLY SCHEDULE'!B1:B273=$A$2)+('YEARLY SCHEDULE'!D1:D273=$A$2)),
SWITCH(XLOOKUP(SEQUENCE(18),INDEX(li,,1),INDEX(li,,2),""),
"","",
$A$2,"AWAY",
"HOME")
)
in line 1 is the LET and 1st variable "li" which is a 2 column list with 1st column the week # and the 2nd column the HOME TEAM of each row that has this sheet's team name (as either home or road).
line 3 returns the list based on SWITCH. Switch is like a special multiple IF statement. It uses a value in this case found using XLOOKUP to determine which output to give. The XLOOKUP checks week#s 1-18 and returns the corresponding HOME TEAM from the list created in "li" and if that week# isn't found it returns blank (""). The SWITCH then says if the Value is "" then return "", if it is this sheet's team name (A2) then return "AWAY" and if anything else the return "HOME".
Jun 01 2022 08:18 PM
Jun 02 2022 03:12 PM
Jun 17 2022 01:55 AM
Jun 17 2022 06:42 AM
Jun 18 2022 03:45 PM
can help do same thing like other with this file. I try it not getting to work for me. I change table back to text.
Jun 18 2022 08:11 PM
Feb 22 2023 02:21 PM
Feb 22 2023 03:07 PM
@sf49ers19238597 columns in the yearly schedule were C and F instead of D and G
Feb 22 2023 04:38 PM
Feb 23 2023 07:26 AM