+ Reply to Thread
Results 1 to 9 of 9

Excel 2007 : If >=0 and sumif or sumproduct

  1. #1
    Forum Contributor
    Join Date
    10-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    112

    If >=0 and sumif or sumproduct

    I am trying to sum Amount Ordered and Extra together and sum stock and gone together. But if any of the columns have no value, I don't want it to do the calculation. I keep getting an error and I don't know how to fix it.

    But eventually I am trying to write a function in one line in sheet 2 under Traffic so I can assign a conditional formatting.

    So if Sum of Stock and Gone is greater or equal to Sum of Amount Order and Extra it should be 2 or yellow



    =If(Inventory!$E$2:$E$7,Inventory!$A$2:$A$7,Sheet2!$A7,Inventory!$B$2:$B$7,Sheet2!$B7),(Inventory!$F$2:$F$7,Inventory!$A$2:$A$7,Sheet2!$A7,Inventory!$B$2:$B$7,Sheet2!$B7),">=0"),SUM(SUMIFS(Inventory!$E$2:$E$7,Inventory!$A$2:$A$7,Sheet2!$A7,Inventory!$B$2:$B$7,Sheet2!$B7),SUMIFS(Inventory!$F$2:$F$7,Inventory!$A$2:$A$7,Sheet2!$A7,Inventory!$B$2:$B$7,Sheet2!$B7),3,2)
    Attached Files Attached Files
    Last edited by Jerseynjphillypa; 10-20-2011 at 03:02 PM.

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

    Re: If >=0 and sumif or sumproduct

    If I understand correctly, you don't want to sum the 2 columns if either is blank... so try:

    =SUMPRODUCT(--(Inventory!$C$2:$C$7<>""),--(Inventory!$D$2:$D$7<>""),--(Inventory!$A$2:$A$7=A2),--(Inventory!$B$2:$B$7=B2),Inventory!$C$2:$C$7+Inventory!$D$2:$D$7)
    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
    Forum Contributor
    Join Date
    10-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: If >=0 and sumif or sumproduct

    Thanks for your help. Your assumption was correct, but I still got a value of 0, it should be blank. Would I use "" at the end of the function
    Attached Files Attached Files
    Last edited by Jerseynjphillypa; 10-18-2011 at 03:06 PM.

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

    Re: If >=0 and sumif or sumproduct

    The best way to get rid of the 0 is to hide it by formatting the result cells as Custom: 0;-0;;@

  5. #5
    Forum Contributor
    Join Date
    10-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: If >=0 and sumif or sumproduct

    My problem is sometimes 0 can be a valid answer, so if I edit the custom formatting the 0 would not appear

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

    Re: If >=0 and sumif or sumproduct

    Try:

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    10-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: If >=0 and sumif or sumproduct

    That's perfect,, how would I change the code, if they provide me a value in one of the columns out of the two to find the sum.
    Attached Files Attached Files
    Last edited by Jerseynjphillypa; 10-20-2011 at 01:37 PM.

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

    Re: If >=0 and sumif or sumproduct

    Perhaps?

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    10-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: If >=0 and sumif or sumproduct

    What if there is text in the field. How do I prevent it from saying 0 since that's not a valid value for text. I

    I'm using this formula to sum up 4 columns together, two columns together and then comparing their values against one another. How can I run the if statement only if there are sums to add up that is greater or equal to 0.
    Last edited by Jerseynjphillypa; 10-20-2011 at 03:12 PM.

+ 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