Here is my formula (I have edited the name of my sheet as I cannot allow access to it).
=QUERY(IMPORTRANGE("my sheet","Prices"),"select Col1 where Col4 contains '"& L1 &"' limit 1",1)
This is working perfectly for all entries except 1 of them where it is importing 2 cells (the first one blank, the second with the desired result). Since the cell below is filled it cannot overwrite it, and I don't want it to. What would cause this phantom empty cell and how do I prevent it from happening?
if the blank undesired cell is in the first column add and Col1 is not null
like:
=QUERY(IMPORTRANGE("my sheet", "Prices"),
"select Col1
where Col4 contains '"&L1&"'
and Col1 is not null
limit 1", 1)
if you have actual line break issue use regex with \n
like:
=ARRAYFORMULA(REGEXREPLACE(QUERY(IMPORTRANGE("my sheet", "Prices"),
"select Col1
where Col4 contains '"&L1&"'
limit 1", 1), "\n", ))