Prevent duplicates in excel sheet

xl3ruise

New Member
Joined
Oct 27, 2020
Messages
5
Office Version
  1. 2019
Hello,

I want to create a simple form for people who come to do a one-time trial lesson at my gym.
So I want to create a form where we can fill in name, phone number and email. But I want to avoid filling in duplicates.

I saw some examples with = COUNTIF ($ A $ 2: $ A $ 20, A2) <= 1
But when I try I get an error.

It would be nice if it is possible to create a warning box, so if you duplicate a word, you get a warning: "This name already exists, do you want to continue?" If you press yes it will be duplicated and if you say no it will be deleted ..?

Does anyone have an idea?

Regards,
 

Some videos you may like

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,526
Office Version
  1. 365
Platform
  1. Windows
If you select A2:A20, then click on data validation(on the data ribbon tab) then in settings select Custom under allow & enter this formula
Excel Formula:
=COUNTIFS(A$2:A2,A2)<=1
Then goto the Error Alert tab & under style select "Warning" then Ok
 

xl3ruise

New Member
Joined
Oct 27, 2020
Messages
5
Office Version
  1. 2019
If you select A2:A20, then click on data validation(on the data ribbon tab) then in settings select Custom under allow & enter this formula
Excel Formula:
=COUNTIFS(A$2:A2,A2)<=1
Then goto the Error Alert tab & under style select "Warning" then Ok
Thanks for your reply, but it will gives me this error:
error.png
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,526
Office Version
  1. 365
Platform
  1. Windows
You need to convert the formula to your language version.
If that is Dutch try
Excel Formula:
=AANTALLEN.ALS(A$2:A2;A2)<=1
 
Solution

xl3ruise

New Member
Joined
Oct 27, 2020
Messages
5
Office Version
  1. 2019
You need to convert the formula to your language version.
If that is Dutch try
Excel Formula:
=AANTALLEN.ALS(A$2:A2;A2)<=1
Ohh yayyy!! Thx.. it works!!!! :D
Very happy, thank you!
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,526
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,536
Messages
5,625,390
Members
416,099
Latest member
sudarsan23

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
Top