Results 1 to 5 of 5

Thread: if condition is true, then sum

  1. #1

    Default 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. #2
    MrExcel MVP
    Join Date
    May 2002
    Posts
    14,143

    Default 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. #3

    Default Re: if condition is true, then sum

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

  4. #4
    Board Regular SIXTH SENSE's Avatar
    Join Date
    Oct 2003
    Posts
    1,883

    Default

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

  5. #5
    MrExcel MVP
    Join Date
    May 2002
    Posts
    14,143

    Default 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
    =

    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.

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com