Index Match Help

ItalianPlatinum

Well-known Member
Joined
Mar 23, 2017
Messages
793
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hello - i am not very versed with index match but I am trying to put it to use because I need to lookup multiple conditions. I was able to put a formula together, then using VBA to apply the formula. But when I apply the formula it is putting @ signs in front of my ranges when it does that it causes #VALUE errors. If I remove them manually in the cell my formula operates. Do I have a problem with my formula or my VBA or both?

Formula: =INDEX('Trend'!$C$11:$C$5000,MATCH(0,('Trend'!$A$11:$A$5000=$A10)*('Trend'!$B$11:$B$5000=$D10),0))
Desired result:
5/29/2023

VBA Code:
.Range("I8:Q" & lastrow).Formula = "=IF($R8<>"""",INDEX('Trend'!C$11:C$5000,MATCH(0,('Trend'!$A$11:$A$5000=$A8)*('Trend'!$B$11:$B$5000=$D8),0)),VLOOKUP($D8,'Trend'!$B$11:$P$5000,COLUMNS($I$8:J$5000),0))"

Formula after VBA: =IF($R10<>"",INDEX('Trend'!C$11:C$5000,MATCH(0,(@'Trend'!$A$11:$A$5000=$A10)*(@'Trend'!$B$11:$B$5000=$D10),0)),VLOOKUP($D10,'Trend'!$B$11:$P$5000,COLUMNS($I$8:J$5000),0))

#VALUE!
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hello,
if you turn off structured references, this should fix your issue.
In excel, go to file, click options, select formulas, uncheck the box labeled "Use table names in Formulas".

Cheers!
 
Upvote 0
I get this error
1685135349131.png
 
Upvote 0
That looks to be working, having an issue with my formula itself but that is a separate issue. So Formula2 looks to be it. I cannot say I ever heard of that before is that new? Should I be using that for my formula array?
 
Upvote 0

Forum statistics

Threads
1,215,093
Messages
6,123,068
Members
449,091
Latest member
remmuS24

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