Custom Data Validation Not Working

masouder

Board Regular
Joined
Jul 5, 2013
Messages
118
Office Version
  1. 2013
Platform
  1. Windows
I am attempting to create data validation that prevents users from entering daily vacation hours that exceed their current vacation balance. Users enter vacation hours for each day of the week. If the sum of all hours entered exceeds the balance then I want data validation to kick in and prevent the last entry which pushed the sum over the balance. See the below sheet capture.

I have created a Custom data validation with the following Formula:
Excel Formula:
=SUM($E$5:$I$5)<=$C$5

In the example below total vacation hours entered equals the balance (32). If I increase any of the daily hours then the data validation works and prevents the last entry/change. However, if any of the cells in E5:I5 are blank then the data validation does not work. For example, if I delete the 1 from cell I5 (now the total hours is 31) and then change cell G5 from 7 to 9 for a total of 33 hours then the data validation does not kick in.

Does anyone have idea what I may be doing wrong or if there a workaround to this limitation?

Timesheet Data Entry Test 08232023.xlsm
ABCDEFGHIJ
1
2
3
4MTWTHF
5Vacation Balance3288781
6
7
11
Sheet1
Cells with Data Validation
CellAllowCriteria
E5:I5Custom=SUM($E$5:$I$5)<=$C$5
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
I can't seem to replicate the issue you are having. No matter which cell I delete or change to 0, the validation still triggers when I enter a value to large in any other cell. Not sure why it would behave that way. My only thought is to try this to skip blanks:

Excel Formula:
=SUMIF($E$5:$I$5,"<>")<=$C$5
 
Upvote 0
Solution
Awesome, glad I could help and thanks for the feedback.
 
Upvote 0
One other note: when I replaced the $E$5:$I$5 reference with a name that references the same range then it did not work again. Very odd.
 
Upvote 0
One other note: when I replaced the $E$5:$I$5 reference with a name that references the same range then it did not work again. Very odd.
Hmm, yes, now I see the issue. You might just have to use 0 as a placeholder in any empty cell.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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