how to sum "unique" samples

  • Thread starter Thread starter LindaJane
  • Start date Start date
L

LindaJane

Given the following data in a spreadsheet, is it possible to sum all the red
pencils, all the blue pencils, and all the green pencils if the number of
lots for each color varies? I'm hoping there's a way to sum samples based on
the criteria "unique".


Column 1 Column 2

color: # in each lot:
red 200
red 100
red 50
blue 350
green 200
green 210
green 75
 
Assuming colors are in column A and quantities are in column B, we can use
the SUMIF() worksheet function like this:

=SUMIF(A2:A8,"red",B2:B8)

or if you want, you can enter a color into another cell, say C1 and use the
formula like this:
=SUMIF(A2:A8,C1,B2:B8)
 
hi
=sumif(A2:A8,"red",B2:B8)

or

=sumproduct((A1:A8="red")*(B2:B8))

you'll need a formula for each color(criteria)

Regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top