+ Reply to Thread
Results 1 to 14 of 14

Setting A Rule So The Total Of Sum Must Be 0

Hybrid View

  1. #1
    Registered User
    Join Date
    07-07-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    18

    Setting A Rule So The Total Of Sum Must Be 0

    Hello
    In the attached file I have a total of 40 (highlighted in yellow) which reduces every time that I enter a value into the B Column. Is there anyway of setting up an error message to appear if after the column is filled the 'Points Remaining' figure displays anything but 0? Basically to ensure that all the points are allocated.
    Attached Files Attached Files

  2. #2
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Setting A Rule So The Total Of Sum Must Be 0

    Maybe just a conditional formatting message?

    See attached.
    Attached Files Attached Files
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    07-07-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    18

    Re: Setting A Rule So The Total Of Sum Must Be 0

    Quote Originally Posted by GeneralDisarray View Post
    Maybe just a conditional formatting message?

    See attached.
    Sorry John the attachment doesn't seem to work.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,508

    Re: Setting A Rule So The Total Of Sum Must Be 0

    What happens if sum of column is greater than 40 i.e. over-allocated as can happen now: "Points remaining" is negative. Do want simple message stating "over" or"under" allocation?

    =IF(40-sum(B2:b6)<0,"Points over-allocated","Points under-allocated")

  5. #5
    Registered User
    Join Date
    07-07-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    18

    Re: Setting A Rule So The Total Of Sum Must Be 0

    Quote Originally Posted by JohnTopley View Post
    What happens if sum of column is greater than 40 i.e. over-allocated as can happen now: "Points remaining" is negative. Do want simple message stating "over" or"under" allocation?

    =IF(40-sum(B2:b6)<0,"Points over-allocated","Points under-allocated")
    I need a message to appear if they allocate too much or not enough. Exactly 40 points must be allocated.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Setting A Rule So The Total Of Sum Must Be 0

    Working off John's formula, to have the message show up only when over allocating or when all 5 have been allocated,
    In C7
    =IF(40-SUM(B2:B6)<0,"Points over-allocated",IF(AND(COUNTIF($B$2:$B$6,">0")=5,40-SUM(B2:B6)>0),"Points under-allocated",""))
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,508

    Re: Setting A Rule So The Total Of Sum Must Be 0

    Is it possible to allocate 40 points only filling 4 rows: if so, COUNTIF will "fail".

  8. #8
    Registered User
    Join Date
    07-07-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    18

    Re: Setting A Rule So The Total Of Sum Must Be 0

    Quote Originally Posted by JohnTopley View Post
    Is it possible to allocate 40 points only filling 4 rows: if so, COUNTIF will "fail".
    One row will have to be left blank as whoever is scoring can't give themselves a score. So 'A' can not give 'A' any points.

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Setting A Rule So The Total Of Sum Must Be 0

    You have an issue with your Data Validation. For all 5 cells, it requires that the minimum be < 9 and the Max be > 11. You cannot fulfill this requirement when you are entering your first value. I suggest you do not attach Data Validation to cell B2.

    John, I assume everyone gets at least one point. I could be wrong.

  10. #10
    Registered User
    Join Date
    07-07-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    18

    Re: Setting A Rule So The Total Of Sum Must Be 0

    Quote Originally Posted by ChemistB View Post
    You have an issue with your Data Validation. For all 5 cells, it requires that the minimum be < 9 and the Max be > 11. You cannot fulfill this requirement when you are entering your first value. I suggest you do not attach Data Validation to cell B2.

    John, I assume everyone gets at least one point. I could be wrong.
    Sorry should of explained. I am trying to create a form which I would send to each member of a group for them to score their team mates. The rules are that no one can be scored over 15, one must be scored over 11, one must be scored less than 9, you can't give yourself a score and all 40 points must be allocated.

    I received some help on an earlier thread with the first three rules but now my colleague tells me that all the points must be used as well.

  11. #11
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Setting A Rule So The Total Of Sum Must Be 0

    Okay, so the formula would change to

    =IF(40-SUM(B2:B6)<0,"Points over-allocated",IF(AND(COUNTIF($B$2:$B$6,">0")=4,40-SUM(B2:B6)>0),"Points under-allocated",""))

  12. #12
    Registered User
    Join Date
    07-07-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    18

    Re: Setting A Rule So The Total Of Sum Must Be 0

    Quote Originally Posted by ChemistB View Post
    Okay, so the formula would change to

    =IF(40-SUM(B2:B6)<0,"Points over-allocated",IF(AND(COUNTIF($B$2:$B$6,">0")=4,40-SUM(B2:B6)>0),"Points under-allocated",""))
    Thank you that's very helpful.

  13. #13
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Setting A Rule So The Total Of Sum Must Be 0

    IF you want to include the criteria that a person cannot give points to themselves, you can modify the data validation to

    =AND(MIN($B$2:$B$6)<9,MAX($B$2:$B$6)>11,MAX($B$2:$B$6)<=15,VLOOKUP($B$11, $A$2:$B$6,2,FALSE)=0)

  14. #14
    Registered User
    Join Date
    07-07-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    18

    Re: Setting A Rule So The Total Of Sum Must Be 0

    Quote Originally Posted by ChemistB View Post
    IF you want to include the criteria that a person cannot give points to themselves, you can modify the data validation to

    =AND(MIN($B$2:$B$6)<9,MAX($B$2:$B$6)>11,MAX($B$2:$B$6)<=15,VLOOKUP($B$11, $A$2:$B$6,2,FALSE)=0)
    Even better! Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Conditional Formatting - setting up a icon set rule for traffic light icons??
    By David Johnstone in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 03-26-2013, 05:47 PM
  2. Setting up rule based values in excel - help required
    By fourfourtwo in forum Excel General
    Replies: 1
    Last Post: 07-03-2012, 04:16 AM
  3. Rule Setting Question
    By txm in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 09-22-2009, 08:23 PM
  4. Setting validation rule using code
    By stoney1977 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-14-2007, 07:47 PM
  5. [SOLVED] Trouble setting total for on chart
    By Mark in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-10-2005, 11:06 PM

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