+ Reply to Thread
Results 1 to 4 of 4

adding value only if criteria is true

  1. #1
    gerryR
    Guest

    adding value only if criteria is true

    Hi all. I've 2 columns (see below)

    1 20
    3 35
    2 10
    5 20
    4 25
    2 30
    1 30


    I need to get the total for each number on the lefts corrosponding value on
    the right.

    ie. Total of 1=50
    2=40
    etc

    I tried

    =IF(D15:D21="1", SUM(F15:F21))

    but no joy, can anyone shed some light?
    thanks and regards
    gR



  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Try SUMIF, i.e.

    =SUMIF(D15:D21,1,F15:F21)

    you only need to put quotes around the 1 if data in D15:D21 is text rather than numeric

  3. #3
    Bondi
    Guest

    Re: adding value only if criteria is true


    Hi gR,

    If we say that your data is in column A and B then you can use SUMIF()
    along the lines of :

    =SUMIF(A1:A7,"=1",B1:B7)

    Regards,
    Bondi


  4. #4
    gerryR
    Guest

    Re: adding value only if criteria is true

    Perfect!

    thaks for the very fast reply Bondi!
    gR


    "Bondi" <[email protected]> wrote in message
    news:[email protected]...
    >
    > Hi gR,
    >
    > If we say that your data is in column A and B then you can use SUMIF()
    > along the lines of :
    >
    > =SUMIF(A1:A7,"=1",B1:B7)
    >
    > Regards,
    > Bondi
    >




+ 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