+ Reply to Thread
Results 1 to 9 of 9

Formula to only add negitive numbers in selected field

Hybrid View

  1. #1
    Registered User
    Join Date
    03-21-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    20

    Question Formula to only add negitive numbers in selected field

    Hey Forum,

    I need a formula that only selects the negative numbers in a cell block and adds them up. Would this be a DSUM or a SUMIFS formula? It seems like that would be the right function but I don't know how to enter the parameters in the equation. The Data would need to compile in Cells C37 & C38 tab AIA 1!. The data for C37 would be pulled from AIA 2! D29:38. The data for C38 would be pulled from AIA 2! E:F29:38.

    Thanks all for any help you can give!
    Alexander
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Formula to only add negitive numbers in selected field

    hi Alexander.Tartter. you should probably put in some numbers there & let us know what should be added. my guess is:
    =SUMIF('AIA 2'!D29:D38,"<0")

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    03-21-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Formula to only add negitive numbers in selected field

    Okay its adding everything properly! awesome! Thank you so much

    I just need one last piece. How do I modify that formula so that the cell is blank unless there is data there to meet the parameter of SUMIF("<0"). Would it be along the lines of =IF('AIA 2'!D29:38=">0","",SUMIF("<0")). It won't take that but maybe I'm on the right track? lol

  4. #4
    Registered User
    Join Date
    03-21-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Formula to only add negitive numbers in selected field

    Hey Benishiryo,

    Thanks for the quick response! I could run an example in those columns if that would help. Let me see if that works first, I'll let you know.

  5. #5
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Formula to only add negitive numbers in selected field

    you're very welcome. maybe:
    =IF(COUNT('AIA 2'!D29:D38)=0,"",SUMIF('AIA 2'!D29:D38,"<0"))

    so as long as there's a single number, it'll do the SUMIF. or if you need all 10 numbers present:
    =IF(COUNT('AIA 2'!D29:D38)<10,"",SUMIF('AIA 2'!D29:D38,"<0"))

  6. #6
    Registered User
    Join Date
    03-21-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Formula to only add negitive numbers in selected field

    That almost works but I need it to be if =0 negitive numbers, not just any number. Is there a way to specify =0 ">0","", ? something like that?

  7. #7
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Formula to only add negitive numbers in selected field

    again, a sample excel file with desired results would have save us a few posts. =)

    try:
    =IF(COUNTIF('AIA 2'!D29:D38,"<0")=0,"",SUMIF('AIA 2'!D29:D38,"<0"))

  8. #8
    Registered User
    Join Date
    03-21-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Formula to only add negitive numbers in selected field

    AIA Form.xlsx

    Well here is what you have helped me build so far . I am very happy for it, thank you so much for your help. I attached an older version to my first post Idk if you saw it or not.

    I have one last piece I wanted to try and add but I don't know if it is possible. if you look at AIA 2 you'll see columns labeled C,D,E,F,G.

    Column C is the contract amount
    Column D is what was paid on the contract last month
    Column E&F are what is being requested this month

    What I would like is if I could somehow have excel recognize if the added amounts in D,E,& F are greater than the amount in Column C, and if it is display "ERROR" or something like that.

    Here is where it gets a little harder. I will be sending this form to a lot of my sub contractors once its complete. I need them only to be able to enter a number in that cell, not be able to edit the function, because they will accidently delete something and I'll be getting phone calls all day, and messed up forms.

    I have locked and hidden ever other cell except these, as these cells are the only areas in which they need to input data. Hoping for a little more magic! Thanks man! I've already been able to adapt a lot of the stuff you taught me to other applications its much appreciated.

  9. #9
    Registered User
    Join Date
    03-21-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Formula to only add negitive numbers in selected field

    I tried this in cell D12 but it wouldn't take it.

    =IF(SUM(D12:F12)>C12,”ERROR”,D12,)

    I also tried using data validation on the G column, since the G column is the sum of DEF (Whole number less then or equal to C12) , but it only works if I open the G cell to edit and then hit enter. Otherwise it just allows it to run over the amount.

+ 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