I stumbled on the answer myself thanks to Oz’s video on the Skill Dashboard. Turns out it’s an excel function. In this case INDEX but I wrapped that around SORT because I’m not sure if MARKET_ORDERS always returns highest price first? It seems to but I can’t find any documentation so using SORT to be safe.
For Buy order =MAX(EVEONLINE.MARKET_ORDERS(10000002, $A4.id, 1,$D$2.id).price)
For Sell order =MIN(EVEONLINE.MARKET_ORDERS(10000002, $A4.id,0,$D$2.id).price)