Say that we have a table with 2 columns (Places, Sales), in column "Places" we have the values Home, Work, Other, and in column "Sales" we have the sales values. I want to sum the values in column "Sales" but only the ones that match the "Home" place. Can I do that without using vba?
CodePudding user response:
This can be done using sumif function. Sumif('select the range of category i.e. Places','select the category i.e. Home','range which needs to be summed i.e. sales')
Column A |Column B |Column C |Column D 1 Places | Sales | | Home 2 Home | 10 | | 3 Work | 8 | | 4 Other | 9 | | 5 Cafe | 12 | | 6 Home | 6 | | 7 work | 3 | |
for the above table if you use the =SUMIF(A1:A7,$D$2,B1:B7) or =SUMIF(A:A,"Home",B:B) you will get your answer as 16.