Brandon
Brandon

Reputation: 117

How to calculate values in the cell to the right if the cell to the left matches a certain criteria

Sorry if this is confusing. As you can see in the snapshot; in cell S8 I am trying to do a calculation with the numbers in the Order Amounts column in J28:J42 assuming the "allergens" in column I28:I42 match the allergens in column Q8:Q19. I was trying =if(J28:J42==Q8,) to start, then I was lost because I don't know how to reference the cell to the right of J28 if J28 matches Q8 to use that number for a calculation. enter image description here

Upvotes: 0

Views: 52

Answers (1)

Nikko J.
Nikko J.

Reputation: 5533

In cell S8 try this formula:

=ARRAYFORMULA(VLOOKUP(Q8:Q23, I28:J43, 2, FALSE))

Sample Data:

enter image description here

Output:

enter image description here

Reference:

Upvotes: 1

Related Questions