+ Reply to Thread
Results 1 to 4 of 4

Adding a column of numbers, with a condition

  1. #1
    Registered User
    Join Date
    01-11-2006
    Posts
    16

    Adding a column of numbers, with a condition

    I'd like to be able to create a cell which is the sum of the values in column A, but only if the value of column B in the cell beside the value in Column A is equal to some number (like = 12).

    So that for this

    col A col B
    3 45
    30 12
    34 12

    Sum of Column A where column B is also =12 would be 30+34 = 64

    (I'd end up wanting a bunch of cells like this, using different numbers instead of 12, ie another cell that has the sum of column A where column B is =11)

    What's the best way to do this?

  2. #2
    Bob Phillips
    Guest

    Re: Adding a column of numbers, with a condition

    =SUMIF(B:B,12,A:A)

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "yozzdi" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I'd like to be able to create a cell which is the sum of the values in
    > column A, but only if the value of column B in the cell beside the
    > value in Column A is equal to some number (like = 12).
    >
    > So that for this
    >
    > col A col B
    > 3 45
    > 30 12
    > 34 12
    >
    > Sum of Column A where column B is also =12 would be 30+34 = 64
    >
    > (I'd end up wanting a bunch of cells like this, using different numbers
    > instead of 12, ie another cell that has the sum of column A where column
    > B is =11)
    >
    > What's the best way to do this?
    >
    >
    > --
    > yozzdi
    > ------------------------------------------------------------------------
    > yozzdi's Profile:

    http://www.excelforum.com/member.php...o&userid=30376
    > View this thread: http://www.excelforum.com/showthread...hreadid=532909
    >




  3. #3
    Registered User
    Join Date
    01-11-2006
    Posts
    16
    Thanks! This works great.

  4. #4
    ANdras
    Guest

    Re: Adding a column of numbers, with a condition

    Hi there,

    can even evolve it, replacing the "12" in the middle to a cell reference
    c2: = SUMIF( B:B;a2;A:A)
    C3: = SUMIF(C:C;a3;A:A) etc.

    best regards,
    ANdras
    (Hungary)

    "yozzdi" wrote:

    >
    > Thanks! This works great.
    >
    >
    > --
    > yozzdi
    > ------------------------------------------------------------------------
    > yozzdi's Profile: http://www.excelforum.com/member.php...o&userid=30376
    > View this thread: http://www.excelforum.com/showthread...hreadid=532909
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1