Data Validation with conditions

Fahad987

New Member
Joined
Nov 29, 2021
Messages
6
Office Version
  1. 2013
  2. 2010
Platform
  1. Windows
Hi,

I am working on setting up custom data validation as data is entered by the user. I have two columns A and B. In column A, i enter today's date (not using today() function). It is a named range with name "myDate". In column B, i type in customer names. however, sometimes there are a lot of customer names to enter and one or two names get typed again. I want to apply data validation on column B such that for only today's entries, if i happen to enter any customers' name twice in column B, the data validation rule prompts me that it has already been entered. For now, i am trying to enter this into my custom data validation rule:
=IF(myDate=today(), Countif($B$2:$B$50,B2)=1, 0)
But it does not restrict any duplicate entries in column B. When I use this countif formula without the IF condition only on column B data range, it works fine.

My Current data structure:

ColumnA ColumnB
myDate CustomerNames
29-11-2021 ABC
29-11-2021 LMN
30-11-2021 ABC
30-11-2021 LMN
30-11-2021 XYZ
30-11-2021 ABC <--- Here it should give me error message but only based on today's datewise entries.

I need this date conditional check because for the next day, i will resume data entries from right beneath my today's entries. So help from forum members here would be really great.
 

Fahad987

New Member
Joined
Nov 29, 2021
Messages
6
Office Version
  1. 2013
  2. 2010
Platform
  1. Windows
Thanks to both of you Fluff and Peter. You both are indeed helpful. Looking forward to having your guidance again should i come up with any new challenge beyond my present knowledge :) (y)
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
73,240
Office Version
  1. 365
Platform
  1. Windows
Glad we could help & thanks for the feedback.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,130
Messages
5,835,573
Members
430,367
Latest member
User800

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