Summing Data based on Its Category

G

Guest

I have a spread sheet that has data on buldings set up in such a way that the
rows are different room types and the columns are Floor Type and Sq.
Footage. At the bottom of the sheet I have a row that gives total square
footage for each floor type of all the rooms combined.

Right now I am using the Sum() function but I have to go through and
individually select sq footages for the respective floor type. For example
if 3 rooms have a cement floor I look down the sq footage column and sum the
ones that have "cement" in the floor type column, and same with capret, etc.
respectively.

Is there a way to use an if statement or anything else so that excel
automatically searches for a certain floor type and only adds the square
footage for those and puts that value in a cell.

Help if you can.
 
J

Jay

I have a spread sheet that has data on buldings set up in such a way
that the rows are different room types and the columns are Floor Type
and Sq. Footage. At the bottom of the sheet I have a row that gives
total square footage for each floor type of all the rooms combined.
...
Is there a way to use an if statement or anything else so that excel
automatically searches for a certain floor type and only adds the
square footage for those and puts that value in a cell.

One way is to use SUMIF.

Below is an example as a CSV file that can be loaded into Excel.

(Hopefully, plain ascii text like this doesn't violate the "attachments"
taboo.)

----------------- cut here --------------
cement,12444
wood,1144
cement,4563
carpet,4444
cement,1258
wood,2467
wood,14244
wood,6465
carpet,12345


Totals,
cement,"=SUMIF(A$1:A$11,A13,B$1:B$11)"
wood,"=SUMIF(A$1:A$11,A14,B$1:B$11)"
carpet,"=SUMIF(A$1:A$11,A15,B$1:B$11)"
 
B

Biff

Hi!

Floor type range = C2:C100
Sq. Footage range = D2:D100

=SUMIF(C2:C100,"cement",D2:D100)

Better if you use a cell to hold the criteria:

A1 = cement

=SUMIF(C2:C100,A1,D2:D100)

Biff
 

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

Top