SOLVED
Home

Some Excel help - Data validation using name ranges - force option if "False"

%3CLINGO-SUB%20id%3D%22lingo-sub-504018%22%20slang%3D%22en-US%22%3ESome%20Excel%20help%20-%20Data%20validation%20using%20name%20ranges%20-%20force%20option%20if%20%22False%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-504018%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20I%20was%20looking%20for%20some%20help%20please.%20I%20have%20used%20a%20range%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIF(%24N%2428%3D%22True%22%2C%24Q%243%3A%24Q%244%2CIF(%24N%2428%3D%22False%22%2C%24Q%244))%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethis%20works%20fine%2C%20in%20that%20the%20O3%20%26amp%3B%20O4%20cells%20are%20just%20Yes%2FNo%20selections..%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethis%20is%20being%20driven%20from%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIF(%24C%2422%26gt%3B%3D590%2C%22True%22%2C%22False%22)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ein%20my%20data%20validation%20I%20just%20use%20%3D%3CRANGENAME%3E%3C%2FRANGENAME%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ehowever%20is%20there%20a%20way%20so%20that%20it%20forces%20the%20data%20validation%20to%20switch%20to%20%22No%22%20when%20No%20is%20the%20only%20option%20available..%20By%20this%20I%20mean%20if%20they%20have%20populated%20a%20calculation%20sheet%20and%20being%20able%20to%20select%20the%20Yes%20option%2C%20if%20they%20then%20change%20the%20number%20and%20it%20falls%20below%20590..%20The%20field%20will%20still%20populate%20as%20%22Yes%22%20even%20though%20this%20isnt%20a%20valid%20option%20any%20longer...%20When%20you%20click%20the%20drop%20down%20it%20will%20only%20have%20%22No%22%20as%20the%20option%2C%20but%20is%20there%20a%20way%20to%20force%20it%20to%20switch%20to%20No%20if%20its%20below%20that%20590%20range%3F%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ehope%20this%20makes%20sense...%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-504018%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E%22False%22)%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E%22True%22%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E%3DIF(%24C%2422%26gt%3B%3D590%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-504473%22%20slang%3D%22en-US%22%3ERe%3A%20Some%20Excel%20help%20-%20Data%20validation%20using%20name%20ranges%20-%20force%20option%20if%20%22False%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-504473%22%20slang%3D%22en-US%22%3E%3CP%3Ecan%20mark%20this%20as%20resolved..%20had%20to%20use%20a%20VBA%20script%20which%20is%20something%20i%20just%20learned%20today%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Efor%20anyone%20it%20may%20potentially%20help%20who%20googled%20and%20found%20this%20however%20I've%20added%20what%20I%20used%20above%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eyou%20go%20into%20VBA%20(Alt%2BF11)%2C%20choose%20the%20worksheet%20you%20want%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eclick%20the%20%22change%22%20option%20on%20the%20right%20side%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eand%20add%20the%20code%20below%3A%3C%2FP%3E%3CP%3EIf%20Target.Address%20%3D%20%22%24C%244%22%20Then%3CBR%20%2F%3ERange(%22E28%22).Value%20%3D%20%22Please%20Select...%22%3C%2FP%3E%3CP%3EEnd%20If%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E(change%20the%20cell%20values%20to%20match%20the%20ones%20you%20need..)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-504517%22%20slang%3D%22en-US%22%3ERe%3A%20Some%20Excel%20help%20-%20Data%20validation%20using%20name%20ranges%20-%20force%20option%20if%20%22False%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-504517%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F330526%22%20target%3D%22_blank%22%3E%40OwenO%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIf%20I%20have%20understood%20your%20question%20correctly%2C%20the%20answer%20is%20that%20there%20is%20no%20way%20of%20forcing%20an%20input%20cell%20to%20switch%20to%20%22No%22%20if%20C22%20is%20below%20that%20590%20range%3F%26nbsp%3B%20It%20is%20possible%20to%20build%20the%20references%20to%20the%20data%20so%20that%20C22%20is%20tested%20and%20if%20it%20is%20%26lt%3B590%20the%20%22Yes%22%20is%20simply%20ignored%20and%20%22No%22%20is%20used%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3D%20IF(C22%26lt%3B590%2C%20%22No%22%2C%20UserInput)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20would%20also%20observe%20that%20you%20appear%20to%20be%20going%20round%20in%20circles%20using%20%22True%22%2F%22False%22%20and%20%22Yes%22%2F%22No%22%20to%20represent%20the%20Boolean%20values%20TRUE%2FFALSE%20%5Bor%2C%20alternatively%2C%201%2F0%5D.%26nbsp%3B%20Using%20Boolean%20values%20your%20first%20formula%20reduces%20to%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3D%20IF(%24N%2428%2C%20%24Q%243%3A%24Q%244%2C%20%24Q%244)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Ewhilst%20the%20next%20one%20is%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3D%20%24C%2422%26gt%3B%3D590%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIf%20you%20prefer%200%2F1%20to%20FALSE%2FTRUE%20then%20the%20functions%20N()%20and%20SIGN()%20each%20convert%20Booleans%20to%20integers%20which%20allows%20custom%20number%20formatting.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-504529%22%20slang%3D%22en-US%22%3ERe%3A%20Some%20Excel%20help%20-%20Data%20validation%20using%20name%20ranges%20-%20force%20option%20if%20%22False%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-504529%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F214174%22%20target%3D%22_blank%22%3E%40Peter%20Bartholomew%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%20for%20the%20reply%2C%20the%20reason%20I%20done%20the%20true%20and%20false%20is%20because%20if%20its%20590%20or%20over%20I%20want%20the%20user%20to%20have%20the%20ability%20to%20select%20Yes%20or%20No%2C%20but%20if%20under%20590%20then%20the%20cell%20to%20automatically%20update%20to%20No%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eis%20this%20possible%20with%20the%20formula%20you%20referenced%20do%20you%20think%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-504531%22%20slang%3D%22en-US%22%3ERe%3A%20Some%20Excel%20help%20-%20Data%20validation%20using%20name%20ranges%20-%20force%20option%20if%20%22False%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-504531%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F330526%22%20target%3D%22_blank%22%3E%40OwenO%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAgreed%2C%20a%20VBA%20solution%20responding%20to%20an%20event%20will%20do%20it!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-504773%22%20slang%3D%22en-US%22%3ERe%3A%20Some%20Excel%20help%20-%20Data%20validation%20using%20name%20ranges%20-%20force%20option%20if%20%22False%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-504773%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F330526%22%20target%3D%22_blank%22%3E%40OwenO%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMany%20things%20are%20possible%2C%20that%20does%20not%20necessarily%20mean%20they%20are%20a%20good%20idea.%26nbsp%3B%20It%20is%20only%20too%20easy%20to%20get%20caught%20out%20by%20one's%20own%20'cleverness'%20at%20a%20later%20date!%26nbsp%3B%20Using%20Booleans%20rather%20than%20strings%20probably%20is%20a%20good%20idea%20but%20the%20number%20formatting%20within%20conditional%20formats%20is%20a%20step%20too%20far.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
OwenO
New Contributor

Hi I was looking for some help please. I have used a range 

 

=IF($N$28="True",$Q$3:$Q$4,IF($N$28="False",$Q$4))

 

this works fine, in that the O3 & O4 cells are just Yes/No selections.. 

 

this is being driven from 

 

=IF($C$22>=590,"True","False")

 

in my data validation I just use =<rangename>

 

however is there a way so that it forces the data validation to switch to "No" when No is the only option available.. By this I mean if they have populated a calculation sheet and being able to select the Yes option, if they then change the number and it falls below 590.. The field will still populate as "Yes" even though this isnt a valid option any longer... When you click the drop down it will only have "No" as the option, but is there a way to force it to switch to No if its below that 590 range??

 

hope this makes sense... 

5 Replies
Solution

can mark this as resolved.. had to use a VBA script which is something i just learned today

 

for anyone it may potentially help who googled and found this however I've added what I used above

 

you go into VBA (Alt+F11), choose the worksheet you want

 

click the "change" option on the right side

 

and add the code below:

If Target.Address = "$C$4" Then
Range("E28").Value = "Please Select..."

End If

 

(change the cell values to match the ones you need..)

@OwenO 

If I have understood your question correctly, the answer is that there is no way of forcing an input cell to switch to "No" if C22 is below that 590 range?  It is possible to build the references to the data so that C22 is tested and if it is <590 the "Yes" is simply ignored and "No" is used

= IF(C22<590, "No", UserInput)

 

I would also observe that you appear to be going round in circles using "True"/"False" and "Yes"/"No" to represent the Boolean values TRUE/FALSE [or, alternatively, 1/0].  Using Boolean values your first formula reduces to

= IF($N$28, $Q$3:$Q$4, $Q$4)

whilst the next one is

= $C$22>=590

 

If you prefer 0/1 to FALSE/TRUE then the functions N() and SIGN() each convert Booleans to integers which allows custom number formatting.

@Peter Bartholomew 

 

thanks for the reply, the reason I done the true and false is because if its 590 or over I want the user to have the ability to select Yes or No, but if under 590 then the cell to automatically update to No

 

is this possible with the formula you referenced do you think?

 

 

@OwenO 

Agreed, a VBA solution responding to an event will do it!

@OwenO 

Many things are possible, that does not necessarily mean they are a good idea.  It is only too easy to get caught out by one's own 'cleverness' at a later date!  Using Booleans rather than strings probably is a good idea but the number formatting within conditional formats is a step too far.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
22 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
13 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies
PacketMon Components are not loading in WAC 1909
HotCakeX in Windows Admin Center on
2 Replies