# if condition is true, then sum

This is a discussion on if condition is true, then sum within the Excel Questions forums, part of the Question Forums category; I have the following data in seperate columns: 2 M 5 C 3 C 3 C 4 M 2 M ...

1. ## if condition is true, then sum

I have the following data in seperate columns:

2 M
5 C
3 C
3 C
4 M
2 M
6 B

I want ot know how many M's, C's , and B's are there
M=
C=
B=

How do write a formula that will add all the numbers that are M's, C's and B's

2. ## Re: if condition is true, then sum

hi - welcome to the board!

reivew the help files for the sumif() & countif() functions. also check out pivot tables. post back if you need more.

3. ## Re: if condition is true, then sum

I can't get the formula to work. It keeps coming up with Zero

4. hi!
try this!
=sumif(b:B,"M",a:A)
where column B is the crietria and coumn A is the values
to sum up.

5. ## Re: if condition is true, then sum

******** ******************** ************************************************************************>
 Microsoft Excel - Book1 ___Running: xl2000 : OS = Windows Windows 2000
 File Edit View Insert Options Tools Data Window Help About
 D3E3F3D4E4F4 =

A
B
C
D
E
F
1
NumID****
2
2MCount*What?MCB
3
5CHow*Many*instances*in*Col*B?331
4
3CSum*of*values*in*Col*A8116
5
3C****
6
4M****
7
2M****
8
6B****
9
**IDDataTotal*
10
**BSum*of*Num6*
11
***Count*of*ID1*
12
**CSum*of*Num11*
13
***Count*of*ID3*
14
**MSum*of*Num8*
15
***Count*of*ID3*
16
**Total*Sum*of*Num*25*
17
**Total*Count*of*ID*7*
 Sheet2 *

[HtmlMaker light Ver1.10] To see the formula in the cells just click on the cells hyperlink or click the Name box
PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•