Find Value in Table

Steve 1962

Active Member
Joined
Jan 3, 2006
Messages
379
Office Version
  1. 365
Platform
  1. Windows
Hi

I am getting errors in column H. Although the data are shown on this one worksheet, in reality the table (cells A1 to C32) will be located on a separate worksheet.

The objective is to identify whether the team being analysed in cell E2 is playing "HOME" or "AWAY".

Thanks

Book1
ABCDEFGHI
1WeekTeam - HomeTeam - AwayTeam AnalysedWeekTeamGround
21Sea EaglesRabbitohsBroncos1Roosters#VALUE!Should read "HOME"
31RoostersBroncos2Rabbitohs#VALUE!Should read "AWAY"
41KnightsRaiders3Panthers#VALUE!Should read "HOME"
51WarriorsSharks4Cowboys#VALUE!Should read "AWAY"
61StormPanthers
71EelsBulldogs
81TitansDragons
91DolphinsCowboys
102BroncosRabbitohs
112SharksBulldogs
122PanthersEels
132RaidersTigers
142CowboysKnights
152StormWarriors
162Sea EaglesRoosters
172DolphinsDragons
183PanthersBroncos
193WarriorsRaiders
203RoostersRabbitohs
213BulldogsTitans
223DragonsCowboys
233TigersSharks
243EelsSea Eagles
253KnightsStorm
264RoostersPanthers
274RabbitohsBulldogs
284BroncosCowboys
294DragonsSea Eagles
304TitansDolphins
314WarriorsKnights
324SharksRaiders
Sheet3
Cell Formulas
RangeFormula
G2:G5G2=IFERROR(LOOKUP(2,1/($A$2:$A$32=$F2)/($C$2:$C$32=$E$2),$B$2:$B$32),LOOKUP(2,1/($A$2:$A$32=$F2)/($B$2:$B$32=$E$2),$C$2:$C$32))
H2:H5H2=CHOOSE(AGGREGATE(15,6,COLUMN($B$1:$C$1)/($B$2:$C$32=G2)/($A$2:$A$32=F2)-3,1),"Home","Away")
 
Seems we cannot see the 'Main' table nor all the data on this sheet so basically impossible to see why it is not extending down as far as you expect. Instead, can you upload the file to dropBox or OneDrive or Google Drive etc and provide a publicly shared link here?
 
Upvote 0

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
OK Peter. Will do. Just have to work out how to share via OneDrive or Google. Never had to do it before.
 
Upvote 0
Hi

Below is my attempt to share the Excel file.

Football Results.xlsm


1drv.ms
1drv.ms

The issue is with column E on the BRONCOS worksheet where the TOCOL function only extends down to row 25.

Thanks
 
Upvote 0
The issue is that the Table sheet has 27 rounds but the Broncos only play in 24 of them (due to byes). The subject of byes did not occur or get a mention with your original sample/question. :)
I think a different approach may be needed. I'll have a think about it.
 
Upvote 0
What about these two formulas?

Steve 1962 Football Results.xlsm
ABCDE
1BroncosWeekTeamGround
21RoostersAway
32RabbitohsHome
43PanthersAway
54CowboysHome
65StormAway
76DolphinsHome
87RaidersHome
98TigersAway
109RoostersHome
1110EelsAway
1211Sea EaglesAway
1312TitansHome
1413ByeBye
1514SharksHome
1615RabbitohsAway
1716ByeBye
1817WarriorsAway
1918PanthersHome
2019DragonsHome
2120KnightsAway
2221BulldogsHome
2322TitansAway
2423CowboysAway
2524ByeBye
2625EelsHome
2726DolphinsAway
2827StormHome
Broncos
Cell Formulas
RangeFormula
A1A1=TEXTAFTER(CELL("filename",A1),"]")
D2:D28D2=BYROW(C2:C28,LAMBDA(r,IFERROR(SUBSTITUTE(CONCAT(FILTER(Main[[Team - Home]:[Team - Away]],(Main[Week]=r)*((Main[Team - Home]=A$1)+(Main[Team - Away]=A$1)))),A$1,""),"Bye")))
E2:E28E2=IF(D2#="Bye",D2#,IF(COUNTIFS(Main[Week],C2:C28,Main[Team - Home],A1),"Home","Away"))
Dynamic array formulas.
 
Upvote 0
Solution
Peter - I have no idea how you do it but this is absolutely BRILLIANT !!!

Works as required to do so.

Thanks for your patience and great knowledge with this.

Steve
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,128
Members
453,021
Latest member
Justyna P

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