+ Reply to Thread
Results 1 to 5 of 5

Validate the sum of multiple validated cells

  1. #1
    Registered User
    Join Date
    09-01-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    2

    Validate the sum of multiple validated cells

    Hello,

    I am making a browser based nation simulator game for a school project, and I need some help.

    nsexcelhelp.jpg

    I would like to force the user to enter three numbers in range D24:D26 that will add up to either zero or 100. The green values have Data Validation forcing them to be whole numbers between 0 - 100.

    I can't figure this out after extensive googling and any help would be much appreciated. I'm quite new to Excel so I might not be searching for the right terms.

    Daniel

  2. #2
    Forum Contributor
    Join Date
    12-22-2010
    Location
    Rio, Brazil
    MS-Off Ver
    Excel 2010, 2016
    Posts
    209

    Re: Validate the sum of multiple validated cells

    Maybe this

    Select D24:D26

    Data > Data Validation > Data Validation

    Allow:
    Custom

    Formula:
    =OR(AND(COUNT($D$24:$D$26)<3,SUM($D$24:$D$26)<=100,$D24>=0,$D24<=100,INT($D24)=$D24),AND(COUNT($D$24:$D$26)=3,SUM($D$24:$D$26)=100,$D24>=0,$D24<=100,INT($D24)=$D24))
    Last edited by mlcb; 09-01-2013 at 06:25 PM. Reason: Simpler formula
    Marcelo Branco

  3. #3
    Forum Contributor
    Join Date
    12-22-2010
    Location
    Rio, Brazil
    MS-Off Ver
    Excel 2010, 2016
    Posts
    209

    Re: Validate the sum of multiple validated cells

    Formula can be shortened to:

    =AND($D24>=0,$D24<=100,INT($D24)=$D24,OR(AND(COUNT($D$24:$D$26)<3,SUM($D$24:$D$26)<=100),AND(COUNT($D$24:$D$26)=3,SUM($D$24:$D$26)=100)))

  4. #4
    Registered User
    Join Date
    09-01-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Validate the sum of multiple validated cells

    Thanks for the reply.

    After I applied the formula it becomes impossible to change any of the values in those 3 cells (I assume because as soon as one is changed the values no longer add up)

    Any idea how I can get around this?

  5. #5
    Forum Contributor
    Join Date
    12-22-2010
    Location
    Rio, Brazil
    MS-Off Ver
    Excel 2010, 2016
    Posts
    209

    Re: Validate the sum of multiple validated cells

    Quote Originally Posted by danieljksn View Post
    Thanks for the reply.

    After I applied the formula it becomes impossible to change any of the values in those 3 cells (I assume because as soon as one is changed the values no longer add up)

    Any idea how I can get around this?
    Delete first the previous values - 2 or 3 of them.

+ 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. Replies: 7
    Last Post: 05-27-2013, 03:58 AM
  2. Replies: 1
    Last Post: 06-30-2012, 01:54 AM
  3. Validate multiple cells
    By apelegion in forum Excel General
    Replies: 4
    Last Post: 10-07-2009, 02:40 PM
  4. Validate validated cell
    By gandolff in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 02-01-2009, 10:26 PM
  5. How to validate data in already list dropdown validated.
    By Rao Ratan Singh in forum Excel General
    Replies: 2
    Last Post: 06-14-2005, 09:05 AM

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