+ Reply to Thread
Results 1 to 11 of 11

Sum the range of data if two conditions are satisfied

  1. #1
    Registered User
    Join Date
    07-31-2008
    Location
    UK
    Posts
    5

    Sum the range of data if two conditions are satisfied

    Hello Guyz,

    This is my first post, I might make some mistakes in here.

    My data is as follows

    Month Miles Amount Location
    June 8 £3.20 Loc1
    June 8 £3.20 Loc1
    June 8 £3.20 Loc2
    July 8 £3.20 Loc2
    July 8 £3.20 Loc1
    July 38 £15.20 Loc1
    July 4 £1.60 Loc2
    Aug 38 £15.20 Loc2
    Aug 4 £1.60 Loc1
    Aug 8 £3.20 Loc1

    Here is what I want to do

    - Avoide filtering and manually calculating data for the total expense in the month

    I want to SUM all the (3)AMOUNT in the (1)MONTH of JUNE for
    (4)LOCATION LOC1

    I know its too much to ask for but can you suggest if i can combine SUMIF or SUM(IF) or any other formulas ???

    thanks and cheers!!

    Mihir

  2. #2
    Registered User
    Join Date
    07-30-2008
    Location
    ITALY
    Posts
    6
    Thi is the formula that meet you need:

    =SUM.IF(RANGE(FIRST CELL COLOUMN MONTH.:LAST CELL COLUMN MONTH);RANGE("WHERE YOU EDIT THE MONTH NAME YOU REFER TO");RANGE(FIRST CELL COLOUMN AMOUNT:RANGE LAST CELL COLOUMN AMOUNT)

    It is necessary you edit in a cell, the name of the month you refer to. The formula give you the total amount as per name month edited

  3. #3
    Registered User
    Join Date
    07-30-2008
    Location
    ITALY
    Posts
    6
    Sorry, I forgot an additional suggestion:

    if you add a new column range with the following formula
    =Range("A")&Range("D")

    range("A)=Month name column
    Range("D")=loc type

    you join the two values


    edit in a range the content of the target you are looking for:

    JuneLoc1

    with the formula I sent you before you get the total amount for the month @ the location selected.

  4. #4
    Registered User
    Join Date
    07-31-2008
    Location
    UK
    Posts
    5
    Hello Jeff,

    Not sure about sum.if or sumif; it was confusing.

    but i have attached the file with the formula's i tried.

    please have a look at it if you can spare some time.

    thanks

    Mihir

  5. #5
    Registered User
    Join Date
    07-31-2008
    Location
    UK
    Posts
    5
    didnt attach earlier ...
    Attached Files Attached Files

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try this formula in I7, copied to J7 and then down the 2 columns...

    =SUMPRODUCT(($C$2:$C$28=$H7)*($F$2:$F$28=I$6),$E$2:$E$28)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  7. #7
    Registered User
    Join Date
    07-31-2008
    Location
    UK
    Posts
    5

    Thumbs up

    BINGO!!!!!!

    it works ... and i will drag then down or put the values accordingly ....

    thanks for your help []

    Mihir

  8. #8
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Another Way

    Try pivot tables:

    This shows any breakdown you like, and is fully update-able without having to copy any formulae anywhere, it is also smaller.

    Add data to the table and see how the pivot table calculates (you will need to click anywhere on the table and Data->refresh data).

    NB it needs the dynamic named range (included) to function.

    HTH
    Last edited by Cheeky Charlie; 08-27-2008 at 09:16 AM. Reason: grammar

  9. #9
    Registered User
    Join Date
    07-31-2008
    Location
    UK
    Posts
    5
    this one's working fine too,

    I am facing some problems with pivot table data while using it for another link.

    Trying to figure out a fix to it.....

    thanks,

    Mihir

  10. #10
    Registered User
    Join Date
    07-30-2008
    Location
    ITALY
    Posts
    6
    I attached your file duly modified.
    It works.
    I have added a new column with the code (month name & location type)
    Month name: from the list lef side
    & = join
    Location type= from the "haeding of the table at right side"
    Read the formula content in each cell of the right table and you understand
    why it works.
    Ciao
    Jeff Italy
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561
    Not sure exactly what your linking other tables problem is, but a general tip:

    If you click on a pivot table cell to reference it in a formula, Excel will put the "access the pivot table this way" syntax into the formula for you - this is very powerful, but much more often(!) you just want the cells in a column, typing in the cell reference (as opposed to clicking) will work and formulae made this way will copy across rows and columns as expected.

    HTH

+ 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