Complex data validation problem

teachman

Active Member
Joined
Aug 31, 2011
Messages
321
Hello and Happy New Year to y'all!

I thought I'd start my New Year off right with a data validation problem. Setting: cell K6 holds 2 char state abbreviation; cell AH12 holds elevation at a specific latitude/longitude.

Problem, I want to make sure the user doesn't enter an elevation value (AH12) that is outside the elevation range found in the state (K6). I have a lookup table with three columns, ST, Max Elev, and Min Elev. I've set the table as the named range StMaxMinElev. That's about as far as I can get. I suppose I could use a series of nested IF statements, but there must be a better way.

I would appreciate any help y'all can give me.

Thanks,


George Teachman
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Data > Data Validation > Data Validation > Custom

Try this formula
=AND(VLOOKUP(K6,StMaxMinElev,2,0)>=AH12,VLOOKUP(K6,StMaxMinElev,3,0)<=AH12)

M.
 
Upvote 0
Marcelo,

Thanks for the help. That is a lot easier than trying to do it with vba scripting.

George
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,260
Members
449,075
Latest member
staticfluids

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