Module 13 · Dynamic Arrays
Price and stock in one formula

During book week, the phone rings all day. Customers ask for a price, and then: do you have it? Nadia wants price and stock with one formula. Then she can fill whole orders fast.
Steps
Return two columns
XLOOKUP can return more than one column. Use a return range with two columns, for example D5:E16. The result spills to the right.
How to do it
- Click cell H5.
- Type =XLOOKUP( with the value to find, the range to search and a comma.
- Type a return range with two columns and a closing bracket.
- Press Enter.
=XLOOKUP(G5,B5:B16,D5:E16)Task: The next customer wants Moss and Iron. Put its price and stock in H6 and I6 with one formula in H6.
Fill the formula down
To use the formula for more rows, fill it down. Lock the ranges with $, for example $B$5:$B$16. Then they do not move.
How to do it
- Click cell H10.
- Type the formula. Put $ in front of the column and the row of each range.
- Press Enter.
- Select the cell with the formula.
- Drag the fill handle down over the other rows.
- Press F4 (Mac: fn+F4) while you type a range to add the $ signs.
=XLOOKUP(G10,$B$5:$B$16,$D$5:$E$16)Task: Fill in the library order. Type one formula in H16 and fill it down to H18.