Conditional Sum

hhammash

Board Regular
Joined
Jun 24, 2002
Messages
156
Hi,

I have a spreadsheet for materials with categories, I want to assign cells for totals for each category.


Example:

Vidoe --> Category 1
Cassette --> Category 2
Audio ---> Category 3

In column A I have the categories
In column B I have the description (video, cassette, audio ..etc)

I have 8 categories (items). How can I set a cell for each category to automatically sum the value of the respective category.

In cell F 2 I want to have the totals of Video, G 2 of Cassettes ..etc.

How can I put a formula in Cell F2 for instance to look for all the categories of 1 and sum them in that cell?

Thank you in advance
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Why a formula. just use a Pivot Table.
But the formula would be
=COUNTIF($A$1:$A$10,"Category 1").
But, you said Sum. Are there numbers to be Summed?

lenze
 
Upvote 0
Hi Lenze,

Yes, there are numbers to be summed. It is about purchasing items. Whenever I purchase a Video I put "1" as a value under category, then the price of the video.

I want to sum all the prices when the category is "1" .

Thanks
 
Upvote 0
Re: Conditional Sum (SOLVED)

Hi,

Solved.

I tried Sumif as follows:
=SUMIF(A2:A15,"=1",B2:B15)

It worked as required.

Thank you Lenze
 
Upvote 0
This is enough if column A contains numbers:

=SUMIF(A2:A15,1,B2:B15)
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top