+ Reply to Thread
Results 1 to 21 of 21

Multiple SUMIF?!

  1. #1
    Registered User
    Join Date
    02-05-2006
    Posts
    86

    Multiple SUMIF?!

    hi
    is there anyway to sum the total of certain cells in one column if they meet criteria in two other columns?!
    for example
    F...........I...........U
    736......CMP......-250
    736......REC.......-100
    729......CMP......-150
    736......CMP......-200
    711......CMP........-50
    736......ZAC.......-150

    i need to sum the total of the cells in column U, where column F is 736 AND column I is CMP?!
    how can i go about this?
    thanks
    Last edited by rjmills18; 07-17-2008 at 10:44 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try Sumproduct()

    =Sumproduct((F1:F100=736)*(I1:100="CMP")*(U1:U100))

    adjust ranges to suit
    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.

  3. #3
    Registered User
    Join Date
    02-05-2006
    Posts
    86
    it is returning #VALUE,
    the range is to cell 1000, and the 736 etc are formatted as text, here is what i put:
    =SUMPRODUCT((F1:F1000="736")*(I1:I1000="CMP")*(U1:U1000))
    cheers

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Does U1 have text in it (a column header perhaps?)

    Try:

    =SUMPRODUCT((F1:F1000="736")*(I1:I1000="CMP"),(U1:U1000))

  5. #5
    Registered User
    Join Date
    02-05-2006
    Posts
    86
    thanks colin, the #VALUE has gone but it now returns nothing when there are cells that meet the criteria???!!

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    colin? whose colin?

    anyways... are you sure there are no extra spaces before after the 736 or CMP entries.?

  7. #7
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256
    Hi,

    I'm Colin. I posted a reply on this thread at 4:02 - exactly the same time as you. It appears that it has been moderated / removed?

    Colin

    Edit:
    Hi NBVC,

    Re. the information you provided in #8, I will quickly summarise the 'missing post' in here to improve the readability of the thread. Thanks.

    Essentially my reply was:
    =====
    The most likely reason for that formula returning #VALUE is that you have column headers, ie. Cell U1 contains text. To cater for this try amending your formula to this:

    =SUMPRODUCT(-(F2:F1000="736"),-(I2:I1000="CMP"),(U2:U1000))
    =====

    So our replies complimented each other's nicely!
    Last edited by Colin Legg; 07-17-2008 at 11:18 AM.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    hmmm...strange... I didn't see that post..... maybe because you say it was exact same time, somehow it got blown away. Not sure...

  9. #9
    Registered User
    Join Date
    02-05-2006
    Posts
    86
    there are no spaces in any cell, these entries are selected from a drop-down list. starting the array at F3 etc removed the ~value but i am still getting a 0 returned!!

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Are the values in column U formatted as text or numbers...

    Try selecting column U and go to Data|Text to Columns... click Finish...

    does that change anything?

    If not, then perhaps attach your sheet here and we can diagnose it better.

  11. #11
    Registered User
    Join Date
    02-05-2006
    Posts
    86
    how do i make it small enough to attach?!

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try zipping it... if it still not less than 100kb... you will have to slim the spreadsheet down to show only some of the records (including ones that should be counted).

  13. #13
    Registered User
    Join Date
    02-05-2006
    Posts
    86
    think that should do it?!
    Attached Files Attached Files

  14. #14
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    I thought you said that 736 was a text entry?... well it seems it is not... it is numeric...

    when I took away the quotes for "736" in the formula, I got a non-zero result...

    Try: =SUMPRODUCT((F4:F1000=736)*(I4:I1000="CMP")*(U4:U1000))

  15. #15
    Registered User
    Join Date
    02-05-2006
    Posts
    86
    brilliant, although some of the entries in that column i will need to search for are text, "PLT" for e.g. is one. if i convert the numbers to text and use "" int the formula should that work....
    ...also, i was hoping to develop the formula so that if the end user selects the criteria from a dropdown list it changes the sum of column to the relevant month they have just selected?
    i.e.736 and CMP remain the same byt if they choose MAY 08 it returns the sum of column W that meets the criteria?!
    thanks so much!!

  16. #16
    Registered User
    Join Date
    02-05-2006
    Posts
    86
    this will be a figure for cell H4 in monthly post if that helps it to make sense?
    If the user switches from Apr 08 to may 08 i need the figure to search the same criteria in the new months column???!!!

  17. #17
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try:

    Please Login or Register  to view this content.
    Note: You can replace "Dec 2008" with the cell reference where the user makes the change...

    Also, 736 and "CMP" can be replaced with Cell references containing those values... then there is no need to change the numbers to text in column F.

  18. #18
    Registered User
    Join Date
    02-05-2006
    Posts
    86
    thank you so much that is absolutely brilliant!!

  19. #19
    Registered User
    Join Date
    02-05-2006
    Posts
    86
    this formula is working for every month except apr 08?! can you suggest why?!
    thanks again!

  20. #20
    Registered User
    Join Date
    02-05-2006
    Posts
    86

    Exclamation

    sorry, the array didnt include apr 08!
    i have a little issue now tho that when i drag the formula down into other cells it is returning a zero value?! here is the code, pre-drag, as you will gather it is another sheet:...
    =SUMPRODUCT(('Dpn Reg'!$F$4:$F$1000=D4)*('Dpn Reg'!$I$4:$I$1000=C4)*(INDEX('Dpn Reg'!$U$4:$IU$1000,,MATCH(A4,'Dpn Reg'!$U$2:$IU$2,0))))
    cheers
    millsy

  21. #21
    Registered User
    Join Date
    02-05-2006
    Posts
    86
    the formatting had switched back on a refernce cell!
    thanks

+ 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