+ Reply to Thread
Results 1 to 12 of 12

Sum of cells (DEF) to not exeed the value of C, Need formula

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

    Sum of cells (DEF) to not exeed the value of C, Need formula

    Here is a billing form I have been working on for a while, I am really happy with it, I just 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 forum magic!

    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.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    245

    Re: Sum of cells (DEF) to not exeed the value of C, Need formula

    Take the last comma out so it's:

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

    I am assuming you are trying this in cell G12, not D12, otherwise it would create a circular reference.
    Last edited by zumbalj; 04-11-2013 at 10:44 AM.

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

    Re: Sum of cells (DEF) to not exeed the value of C, Need formula

    Currently G12 reads like this

    =IF(C12="","",D12+E12+F12)

    I would need to combine the 2 functions so if C12 is not blank it equals SUM(D12:E12) but if sum of D12:E12 is greater than C12 "ERROR"

    Not sure how to put that all together, maybe something like this formula I use to only count positive numbers in a cell range.

    =IF(COUNTIF('AIA 2'!D29:D38,">0")=0,"",SUMIF('AIA 2'!D29:D38,">0"))
    Last edited by Alexander.Tartter; 04-11-2013 at 12:36 PM.

  4. #4
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    245

    Re: Sum of cells (DEF) to not exeed the value of C, Need formula

    Try
    =IF(C12="","",IF(D12+E12+F12>C12,"ERROR",D12+E12+F12))

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

    Re: Sum of cells (DEF) to not exeed the value of C, Need formula

    Okay that works great!... unless I have to enter a negative number as some change orders are actually a credit. Then the sum of the cells, is assumed at zero and it gives the error message :P

  6. #6
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    245

    Re: Sum of cells (DEF) to not exeed the value of C, Need formula

    Are you meaning a negative number in cell C12?

    You could use the ABS() function around C12 and around D12+E12+F12 if there's a possibility they'll all be negative to compare the absolute value of the numbers.

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

    Re: Sum of cells (DEF) to not exeed the value of C, Need formula

    Yeah negative in C12, what is the ABS function... sorry I am learning excel as I go. and yes if C12 was negative then DE and F would be a negative number or blank

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

    Re: Sum of cells (DEF) to not exeed the value of C, Need formula

    Okay I tried this

    =IF(ABS(C29)="","",IF(ABS(D29+E29+F29)>C29,"ERROR",D29+E29+F29))

    with negative -500 in C29 and -200 in E29, still giving me an ERROR message.

  9. #9
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    245

    Re: Sum of cells (DEF) to not exeed the value of C, Need formula

    ABS takes the absolute value of the number (basically takes the negative sign away if there is one).

    Try
    =IF(C29="","",IF(ABS(D29+E29+F29)>ABS(C29),"ERROR",D29+E29+F29))

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

    Re: Sum of cells (DEF) to not exeed the value of C, Need formula

    ahhh I see where you are going with this brilliant

  11. #11
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    245

    Re: Sum of cells (DEF) to not exeed the value of C, Need formula

    Excellent! If this fixes your problem, remember to mark the thread "Solved."

    Please hit the start (*) if I've helped you!

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

    Re: Sum of cells (DEF) to not exeed the value of C, Need formula

    Yep just wanted to test it, works Great, thank you for your help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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