The method used here is the OFFSET function which has five arguments. =OFFSET(reference,rows,cols,height,width)
Reference >> Uses O1 as the base (starting point)
Rows >> How many rows down to go. In this case, D6 is used to perform a match against column P to see how far down the column to find the Generic name.
Cols >> How many columns either to the left or to the right to go. In this case, since the start is in O1 and there is nothing to the left, we will go right. For BRAND you don’t go over any columns so nothing , but in the case of PRICE, 2 columns to the right and CODE, 3 columns to the right.
Height >> How many rows match D6?
Width >> Skipped
When all is put together
Notice the -1 at the end of the match which is due to the header row. If for example you pick AMBROXOL 30MG TABS, it is on the 23rd row, but if you go down 23 from O1 this puts you at 24 so we subtract 1 to get back to 23.
Bookmarks