Data Valisdation on Calculated Value

masouder

Board Regular
Joined
Jul 5, 2013
Messages
118
Office Version
  1. 2013
Platform
  1. Windows
I have a table where users enter a percentage for each of the 12 months of the year. I am attempting to use data validation to prevent users from entering numbers where the total of all months exceeds 100%. See below.

If users enter a value in C4:C15 that causes the total in C16 ro exceed 100% then I want data validation to alert the user and prevent the entry. I cannot figure out to do this. Any help is appreciated. Thanks!

Book1
ABCD
1
2
3
4Jan5%
5Feb6%
6Mar7%
7Apr4%
8May3%
9Jun9%
10Jul4%
11Aug6%
12Sep8%
13Oct9%
14Nov4%
15Dec1%
16Total66%
17
18
19
Sheet1
Cell Formulas
RangeFormula
C16C16=SUM(C4:C15)
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
I think this will help. You need to make a custom formula in Data Validation. Select c4:c15 and then create this DV rule.

1717960063205.png
 
Upvote 0
I think this will help. You need to make a custom formula in Data Validation. Select c4:c15 and then create this DV rule.

View attachment 112484
Thanks, DRSteele, this worked.

Question: I originally tried to wrie a custom formula - just as you did - based on the total cell (C16). I wrote is as =$C$16 > 1. It did not work. As I see now fropm your solution that it should be <= 1, not > 1. This does make sense to me: my thinking is that the data validation would kick in when the total exceeds 100%. The <= 1 suggests to me that it would kick in when less or equal to 100%. Can you explain the logic?
 
Upvote 0
The DV rules kick in when they evaluate as true. The formula type DV must be applied to the range itself and must be absolute references for this technique to work.
 
Upvote 0
The DV rules kick in when they evaluate as true. The formula type DV must be applied to the range itself and must be absolute references for this technique to work.
Yes, I understand that it must be applied to the range of values to be netered. I have that working. I'm still stuck, however, on when the rule kicks in. We want the rule to kick in (and the message to display) when the total exceeds 100% so why is it <= 1 instead of > 1?
 
Upvote 0
Well it seems I misunderstood. Yes, change it from <= to <

So sorry.
 
Upvote 0
Look at it this way: The data entered must be validated... i.e. it must pass a test. So the SUM of the range cannot exceed 1.
To avoid negative numbers being entered, you may consider an AND function.
so something like the data validation for cell C4:
Excel Formula:
=AND(C4>=0,SUM($C$4:$C$15)<=1)

1717974435349.png
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,160
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top