Computer Tutoring Logo

How to Prevent Duplicate Enties From Mulitple Columns in Excel?

Preventing Duplicates with Data Validation

I had one client who had a temp take over her work while she was away. When she returned, she found that there were duplicate entries. Now you understand that this issue is a common one, and hopefully, the temp wasn't chastised too much. However, it made me wonder how can I use data validation to stop that from happening? In essence, how to use the data validation options in Excel to prevent yourself, or someone else, from entering duplicate values.

The problem got a little more thorny when multiple columns got involved. To explain a little more, there were two columns: date and student name, and a duplicate is based on the values of both date and student being identical.

Steps to Prevent Duplicate Entries Using Data Validation in Excel

  1. Select the Range: Select the range of cells where you want to prevent duplicate entries. For example, select the range A2:D100 if you have four columns.
  2. Open Data Validation: Go to the Data tab and click on Data Validation in the Data Tools group.
  3. Set Validation Criteria: In the Data Validation dialog box, go to the Settings tab. Choose Custom from the Allow dropdown menu.
  4. Enter Formula: In the Formula box, enter the following formula to check for duplicates across multiple columns:
    =COUNTIFS($A$2:$A$100, A2, $B$2:$B$100, B2, $C$2:$C$100, C2, $D$2:$D$100, D2) = 1
  5. Set Error Alert: Go to the Error Alert tab in the Data Validation dialog box. Check the box for Show error alert after invalid data is entered. Enter a title and error message, such as "Duplicate Entry" and "This entry already exists."
  6. Click OK: Click OK to apply the data validation rules.
  7. Test the Validation: Try entering duplicate values in the specified range to ensure that the data validation works correctly. You should see an error message if a duplicate entry is detected.

By following these steps, you can use data validation in Excel to prevent duplicate entries across multiple columns. This will help you maintain data integrity and avoid issues caused by duplicate entries.

OSZAR »