Instead of using a pivot table and then a vlookup to the pivot table, I would like to simplify and have a vlookup sum if the criteria is correct. Does anyone know how to write this?

silly me. got my answer - sumif.