Google-sheets – Assigning a value to a name from a list

formulasgoogle sheetsgoogle-sheets-arrayformulavlookup

I have items that I'm selling, and I've named these codes with the item I'm selling. I want to give these codes the price they should display. I've already got a formula to show the product of the price and the quantity they want to purchase. I just need to assign these items the price. Help, please.

enter image description here

EDIT:
I've gotten so far as to using an IF operator, but I can only go so far as to just giving it one possible option.

enter image description here

Best Answer

  • delete everything in B column and paste this into B1 cell:

    ={"Price"; ARRAYFORMULA(IFERROR(VLOOKUP(A2:A, H:J, 3, 0)))}

  • delete everything in E column and paste this into E1 cell:

    ={"Total"; ARRAYFORMULA(IF(C2:C<>"", C2:C*D2:D, ))}