#Name error in Let() variable name

Cumberground

New Member
Joined
Feb 28, 2025
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I'm trying to convert a working formula to use Let() in order to simplify things but I'm getting #Name error for the name1 variable.
Old:
Excel Formula:
=IFERROR(IF($AL6="","",INDEX('Scoresheet 1'!$CF$34:$CF$57,MATCH($AL6,'Scoresheet 1'!$CA$34:$CA$57,0))),"")
New:
Excel Formula:
=LET(vScores,'Scoresheet 1'!$CF$34:$CF$57,IFERROR(IF($AL6="","",INDEX(vScores,MATCH($AL6,vScores,0))),""))
The formula looks-up the player name from cell $AL6 and returns the index/matched score from another worksheet - 'Scoresheet 1'!$CA$34:$CA$57

It works perfectly on the old formula but won't work on the new, it fails even if I (rather redundantly) do the following:
Excel Formula:
=LET(vScores,'Scoresheet 1'!$CF$34:$CF$57,IFERROR(IF($AL6="","",INDEX('Scoresheet 1'!$CF$34:$CF$57,MATCH($AL6,'Scoresheet 1'!$CF$34:$CF$57,0))),""))

The array from Scoresheet 1 is returned correctly as {53;47;43;41;40;39;36;36;36;35;34;32;31;31;31;30;29;28;28;27;27;23;22;19} in all three formula
Any ideas why it doesn't like the name1 variable?
I've tried using different variable names just in case...

Thanks
 
The formula shouldn't return #NAME but #N/A as you are trying to match AL6 with col CF rather than col CA
 
Upvote 0
Solution
Ah, thanks Fluff, rooky mistake.
I was so keen to use Let() I forgot to check I was using the correct columns
 
Upvote 0
Doesn't this produce the same:
Excel Formula:
=IF(ISERROR(MATCH($AL6,'Scoresheet 1'!$CF$34:$CF$57,0)),"",$AL6)
I think that you missed that the old (working) formula was looking for $AL6 in column CA & the problem is that the OP's new formulas (& yours) are looking for it in column CF, as @Fluff pointed out in post #3
 
Upvote 0

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