+ Reply to Thread
Results 1 to 8 of 8

Creating an IF formula with SUM using set values and variable values

  1. #1
    Registered User
    Join Date
    06-25-2013
    Location
    Mercerville, New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    4

    Creating an IF formula with SUM using set values and variable values

    I have been working on this for days, and as I am not an Excel expert I just can't seem to get it to do what I want. Here is what I'm trying to do....

    1.find out if the total value of Column C cells to this point is under, equal or over 250.00.
    2.When the value of the total of the C cells exceeds 250.00 take the remainder that is over 250.00 and divide by 2. put the sum in cell D. If the result is = or less than 250.00 the value should read $0.00 in cell D (Not FALSE)
    3. For each cell value after the cell that has exceeded the 250.00 mark take ONLY the value of cell C and divide by 2 and place the sum in Cell D

    I'm sure i'm so far off track here but this is what I did (Amateurish I know) =IF(OR(C4+C5+C6+C7+C8+C9+C10+C11+C12+C13=250,C4+C5+C6+C7+C8+C9+C10+C11+C12+C13<250),"$0.00",SUM(C4+C5+C6+C7+C8+C9+C10+C11+C12+C13-250)/2)
    The problem is I don't know how to automatically decide if the value in C is over, under, or equal AND if just part of the value of the C cell is over, or all of the value is over. For example, on row 13 in my spreadsheet the value exceeds 250.00 for cells C4-C13 by 3.00. the 3.00 then gets divided by 2 and the sum is placed in Cell D. Since I've already exceeded 250.00 the all of the value of any cells after 13 would exceed 250.00 and just that cell value would be divided by 2 and the sum placed in cell D.
    Yes I couldn't figure out how to get the sum calculation of all the cells in the column without adding each one individually.

    Thanks in advance for any assistance - this is a potentially good teaching moment for me

    Rich
    Last edited by rjordine; 06-25-2013 at 06:44 PM.

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Need help with an excel formula please :)

    we can use SUM (with absolute and relative addressing
    MOD to get the remainder
    and if to work out when to do it

    I think this will work
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Need help with an excel formula please :)

    sorry mate but
    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.


    but look at sum()
    C4+C5+C6+C7+C8+C9+C10+C11+C12+C13
    is the same as
    sum(c4:c13)
    Last edited by JBeaucaire; 06-25-2013 at 06:30 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    06-25-2013
    Location
    Mercerville, New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Need help with an excel formula please :)

    Getting closer now the only other modification I need to make is, in the cell who's value exceeds 250.00 I need to have it ONLY calculate the remainder of the value over the 250 mark. Example: C1 50.00 C2 50.00 C3 100.00 C4 73.00 - in this case cells 1-4 take the value over 250.00 but in cell 4 only 23.00 of the 73.00 is divided by 2. For all remaining cells the total value of Cell Cn would be divided by 2. Currently it is taking the entire value of C4 and dividing by 2.

    Rich

  5. #5
    Registered User
    Join Date
    06-25-2013
    Location
    Mercerville, New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Need help with an excel formula please :)

    Thanks Martin - I changed the title. I must have had the syntax wrong because when I tried the SUM () format it was not working.

    Rich
    Last edited by jeffreybrown; 06-25-2013 at 06:42 PM. Reason: No need to quote full posts

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Need Advice creating an IF formula

    slight correction, I was looking at C for a blank and should have been D
    try this

    =IF(AND(D1="",SUM($C$2:C2)>=250), MOD(SUM($C$2:C2),250)/2,IF(SUM($C$2:C2)>=250, C2/2,""))

  7. #7
    Registered User
    Join Date
    06-25-2013
    Location
    Mercerville, New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Creating an IF formula with SUM using set values and variable values

    Perfect!!!! Thank you so much!

    Rich

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Creating an IF formula with SUM using set values and variable values

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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