2 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

Sheet not pulling data from tabs with names that have two words in them

Our take

When working on a statistical model for college basketball teams, you may encounter an issue with Excel not pulling data from tabs named with two-word team names, such as "Oklahoma State." Instead, you receive a #REF! error. The formula you're using references the "ALL TEAMS" sheet to match team names, but it appears to only work for single-word names like "Kansas." This issue likely stems from how the MATCH function interprets spaces in the team names. Let’s explore some strategies to resolve this challenge effectively.

I'm working on a statistical model for college basketball teams. I adapted it from a Google Sheet and decided to try Excel.

Each team is in its own tab, and the tabs are named for the teams themselves (Kansas, Oklahoma State, etc.).

I'm hitting a snag where the spreadsheet will pull data from team tabs that have one name (e.g. Kansas, Cincinnati) but not those with a space in the name (e.g. Oklahoma State). Instead I get a #REF! error. An image is below.

https://preview.redd.it/6io2qvvjhlvg1.png?width=2440&format=png&auto=webp&s=d3188fe1099ad97c247893681ef1f8dac3506611

The formula in the fifth column from the left looks like this:

=IF(D23="D2","D2",INDEX('ALL TEAMS'!$P$2:$P$366,MATCH(B23,'ALL TEAMS'!$B$2:$B$366,0)))

What am I doing wrong here?

UPDATE from below reply:

Actually, no, It's not trying to reference sheet names. It's referencing names in a column on another sheet called "ALL TEAMS".

The problem I think is with the MATCH function. In the formula I provided, I'm asking it to find cell B23 in the ALL TEAMS tab. That column is where the team names are.

It's pulling the teams that have one word in their name, but not the teams that have more than one word.

Putting single quotes around B23 (e.g., 'B23') does not work. It spits a warning out at me about Excel thinking I'm writing a formula.

submitted by /u/algarhythms
[link] [comments]

Read on the original site

Open the publisher's page for the full experience

View original article

Related Articles

Tagged with