Data Validation issue

andrewb90

Well-known Member
Joined
Dec 16, 2009
Messages
1,077
I am using a data validation to create a popup if K3 does not have the number 1-12 in it. Regardless of what seems to be in K3 the popup message always appears. K3 is auto filled in from a different sheet, and the cell will be protected and hidden normally. Am I doing something wrong here?


=IF(K3="",FALSE,IF(OR(K3<1,K3>12),FALSE,TRUE))

Thanks,

Andrew
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
K3 is auto filled in from a different sheet

Do you mean that K3 is a formula referring to another sheet?
Data validation only applies when the cell is manually changed, not via formula.

You would need to apply the data validation on that formula's precedent cell.
Say if K3's formula is
=Sheet2!A1

then you would put the validation in Sheet2 A1, and adjust the cell references accordingly.
 
Upvote 0
Also, formula's in data validation are similar to formulas in conditional formatting.
You do not need to structure them with an IF, because it's already an if by default.
The entry in the cell is only allowed if the formula results in TRUE.
So You only need a formula that returns TRUE or FALSE..


Instead of
=IF(K3="",FALSE,IF(OR(K3<1,K3>12),FALSE,TRUE))

Try
=AND(K3>=1,K3<=12)

This is also easier, because we don't have to test for blank.
Clearly a blank is NOT between 1 and 12.


Also, even easier...
Instead of Custom - formula
use Whole Number - Between


Hope that all helps.
 
Upvote 0
I changed my formula to include the original cell, but the popup still appears.

Also, I want the popup message to appear if the cell has been left blank as well, that's my issue. That cell along with a few others must be filled in for other formulas on other sheets to work, but if that cell is filled in incorrectly or not filled in at all, a popup needs to appear on my selected cells. That cell once it is filled in, will not change again, and it won't be clicked on again either.

=IF(Welcome!T100="",FALSE,IF(OR(Welcome!T100<1,Welcome!T100>12),FALSE,TRUE))
 
Upvote 0
I think you missunderstood me...

The Data validation needs to go on the Welcome Sheet, Cell T100
And the formula would b
=AND(T100>=1,T100<=12)
UNcheck "Ignore blanks"
 
Upvote 0
That would mean the popup would appear after clicking on T100 (assuming it's incorrect data) right?
 
Upvote 0
That doesn't entirely help, because there is a possibility that the cell might get skipped and not have anything typed in it at all, so I need a popup on the other sheet where they will be typing to appear if the cell has been missed.
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,334
Members
452,907
Latest member
Roland Deschain

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
Back
Top