You can use Excel’s Data Validation to limit the total amount that users enter in a group of cells.
For example, if budget is $3500, you can prevent entries that will go over that total amount.
Budget Sheet Setup
Here’s what is on the Budget data entry sheet:
- Cell F1 contains the total amount allowed for the budget, and the cell is named BudgetTotal.
- The user can enter budget amounts in cells C3:C7.
- Cell C8 sums the amounts entered in cells C3:C7.
- Cell F3 shows the amount remaining (BudgetTotal minus total budgeted in C8).
Add the Data Validation
On the Budget Data Entry Sheet, data validation is applied to cells C3:C7, because this is where the data entry occurs.
- Select cells C3:C7
- On the Ribbon, click the Data tab, then click Data Validation. (In Excel 2003, choose Data|Data Validation)
- Choose Allow: Custom
- For the formula, use SUM to total the values in the range $C$3:$C$7. The result must be less than or equal to the amount in the BudgetTotal cell.
=SUM($C$3:$C$7)<=BudgetTotal - Click OK to close the Data Validation dialog box.
Test the Data Validation
After setting up the data validation, you can test it, to make sure that it works as expected.
- In cell C7, enter $900, which is higher than the amount remaining.
- Press Enter, and you should see an error message.
- Click Cancel or Retry, and enter a valid amount.
_______________________
Wow. This really is a great tip.
Thanks, Debra!
Sir i’m facing a problem in excel.
I have a sheet of score card of a exam. In this exam we have 40 questions with 3 section. Section 1 have 20 questions of which only 18 questions are accepted. Section 2 have 10 questions of which only 9 are accepted and in 3rd section only 5 are accepted.
I need solution to it badly. Please help me sir
Thanks Toad, glad you like it!
I like it! I always knew about Data Validation in Access, but never thought of it in Excel, I can’t wait to use it now!
Thanks Dermot! Users can override Excel’s Data Validation, but it’s a good way to point people in the right direction.
I was trying similar formula such as =Sum($a$1:$e$1)<=$f$1. it works. But I need to copy the same rule to the same range in other rows as well.
As you know because of $ symbols copy and past do not work. The rule has to be edited in each row. Not a feasible solution as I have to put the same validation rule in 100s of rows.
So I tried the formula without $ symbols. The formula does not work for the range.
Any clue how to make it work in the first range and also allow it to be copied and paste to other rows to work with row numbers automatically changed to the row copied to.
Hi, can you do this for two columns or rows in excel?