# Index Match within Query



## Simon Campbell (Dec 14, 2022)

I have multiple queries getting data from a combination of Database and Web. I am currently using a complex Index / Match combo (with multiple criteria) to combine data. The Index Match formula I have used is..

=INDEX(wellbore_formation_top[Lithostrat. unit],MATCH(1,([@[Merge1.ef_wellbore.NAME]]=wellbore_formation_top[Wellbore name])*(wellbore_formation_top[Level]="GROUP")*([@MD]>wellbore_formation_top[Top depth '[m']])*([@MD]<=wellbore_formation_top[Bottom depth '[m']]),0))

I would like to avoid this extra step, and integrate the Index Match into the Query directly, but am not sure of the syntax... Is there anyone who can help with this


----------



## hajiali (Dec 16, 2022)

Your formula looks ok. With such index multiple match would be an array formula and would require you to press CTRL+SHIFT+ENTER. Let me know if that works.


----------

