Forum Discussion

Colin59's avatar
Colin59
Copper Contributor
Jul 29, 2022
Solved

How to calculate sum of one column based on a vlookup of another column's values?

Hi, I am trying to find a way to calculate the sum of values in column B based on the value of cells in column A, as in the attached file. So how many of each T-Shirt size are in columns A + B.

 

I have tried to use B20=SUMIF(A20:A24;(VLOOKUP(A20;A2:B16;2;FALSE);B2:B16)) but this throws an error.

 

Any suggestions will be welcomed!

2 Replies

    • Colin59's avatar
      Colin59
      Copper Contributor

      This works! Strange things happen when you have two excel files open and you copy from one to the other (cross-references the file that you copy from). 

       

      Many thanks

Resources