Conditional sum  if
Results 1 to 5 of 5

Thread: Conditional sum if

  1. #1
    Board Regular
    Join Date
    Nov 2016
    Posts
    364
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Conditional sum if

    Hi

    Is there a way to sum one column only if the values in another column are populated?

    So in the example below, there are 5 products: A - E in column A.

    Column B states whether or not a product is 'Live'

    And column C has the sales data for that product.

    I'd like to sum up the sales of the products in column C only if there is a value in column B.

    So the sum total would be 10 instead of 15.

    Has anyone done this before? TIA

    Product Live? Sales
    A Yes 1
    B Yes 2
    C Yes 3
    D Yes 4
    E 5
    15

  2. #2
    Rules violation
    Join Date
    Jan 2012
    Posts
    912
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Conditional sum if

    Simple SUMIF

    =SUMIF(B:B,"Yes",C:C)
    Last edited by theBardd; Jul 29th, 2019 at 07:23 AM.

  3. #3
    Board Regular
    Join Date
    Oct 2015
    Location
    South Wales
    Posts
    549
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Conditional sum if

    I'm assuming that B may not always be blank or Yes? "Not blank" can be tricky in a SUMIF, so sum all and deduct the blanks:
    =SUM(C1:C5)-SUMIF(B1:B5,"",C1:C5)
    Last edited by Trevor_S; Jul 29th, 2019 at 07:31 AM.

  4. #4
    New Member
    Join Date
    Jul 2019
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Conditional sum if

    Quote Originally Posted by Trevor_S View Post
    I'm assuming that B may not always be blank or Yes? "Not blank" can be tricky in a SUMIF, so sum all and deduct the blanks:
    =SUM(C1:C5)-SUMIF(B1:B5,"",C1:C5)

    Why not use =SUMIF(B1:B5,"<>",C1:C5)

  5. #5
    Board Regular
    Join Date
    Nov 2016
    Posts
    364
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Conditional sum if

    Ok, thanks everyone.

    The methods were useful!

Some videos you may like

User Tag List

Tags for this Thread

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
  •