Skip to playerSkip to main content
  • 2 days ago
Learn how to prevent duplicate entries in Excel using data validation.

To avoid duplicate entries in Excel, you can follow these steps using Data Validation and a custom formula. First, create a table by selecting your data range with Ctrl + A, then press Ctrl + T and click OK. In the Table Design tab, name your table "sales". To prevent duplicate entries, select the "Names" column, go to Data ~ Data Tools ~ Data Validation, and choose Custom. Enter the formula =COUNTIFS(INDIRECT("sales[Name]"),B5)
Transcript
00:00This is a story of how I managed to ensure that there is no duplicate entry in my data set.
00:05First you're going to place your cursor somewhere in your data set, press ctrl a to select your
00:10data set, then you press ctrl t. When this create table pop-up comes up, make sure you have a
00:15check
00:15box if your data set have a table like mine, and then click on ok. So this what it does
00:21is that it
00:21creates a table for you out of your data set. While selecting your table like this, select on
00:27table design, and there will be a chance for you to name the table name here. I'm going to call
00:32this
00:33sales and hit enter. That completes the creation of table. The second part will be to prevent duplicate
00:39entry. First you're going to select the name column like this, and then you're going to go to data.
00:45Under data tools, there's data validation. Click on it, a pop-up window will appear. Under setting tabs,
00:50under criteria, you're going to select custom like this, and the formula you'll be entering will be
00:55this. The formula checks if the value of cell B5 appears at most once in the name column. If it
01:03appears once or not at all, the formula returns true, which means no duplicate. If it appears more
01:09than once, it returns false to indicate duplicate entry. Once that's done, go to alert tab here. Make
01:16sure your style is stopped. If you like warning, you can put not warning, but I'm going to select stop
01:20here. On the title, you can give anything you want. I'm going to say duplicate values detected.
01:28This is the title header on your pop-up that's going to show up, and on the error message, you
01:33can
01:33enter anything you want. I'm going to say duplicate values not allowed. Again, I'll show you where all
01:42these messages appear as you do the test shortly after. Once you enter the title and error message,
01:46click on OK, and then now if you try to enter any of this name here, I'm going to enter
01:51Haley Groom,
01:54Haley Groom like this. As you know, we have a duplicate entry in the name. When you hit enter,
01:58a pop-up window will appear indicating that the duplicate values is not allowed, and the title
02:04here says duplicate value detected. Now, if you were to give it a new name like that, which doesn't
02:11exist on your data set, and you press tab, so hit enter, you can see that it accepts the value,
02:17and you're allowed to enter the remaining of the column.

Recommended