Restrict Data Validation

Gilliam

Active Member
Joined
Jul 10, 2014
Messages
286
Hello,
I am having an issue restricting a cell to only what is in the drop down.
I have a cell that is data validated as a list to be passed this:
=IF(B4="Lease",$O$3:$O$6,INDIRECT(VLOOKUP($P$21,$O$2:$S$17,5)))

the indirect passes a range for example "O2:O11" which would fill the drop down with numbers 1 through 10. so after the VLOOKUP, it should look like...
=IF(B4="Lease",$O$3:$O$6,INDIRECT(O2:O11))

Including an error alert does not work in restricting the data, nor does it even do anything... I'm wondering if the formula with indirect is the problem?

Any help would be appreciated, thanks.
 
Cracked it.

Your validation formula is actually using =IF(B4="Lease",$O$3:$O$6,INDIRECT(VLOOKUP($P$21,hola,5))) not =IF(B4="Lease",$O$3:$O$6,INDIRECT(VLOOKUP($P$21,$O$2:$S$17,5))) and your named range 'hola' is defined as $O$1:$S$17, it makes no difference if you change the name to $O$2:$S$17 neither works. It seems the problem is that an embedded named range is just too much for excel to cope with.

I've sent the spreadsheet back to you.

Regards

Peter
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
My pleasure, thanks for the feedback.

Computers should do what we want not the other way round!
 
Upvote 0

Forum statistics

Threads
1,216,166
Messages
6,129,260
Members
449,497
Latest member
The Wamp

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