Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XL 2K3: 'Conditional Validation'

Status
Not open for further replies.

SkipVought

Programmer
Dec 4, 2001
47,489
US


hi,

You can use the OFFSET() function, to define the range for the second DV, based on your selection in the first DV.

Or you could use MS Query to generate the list for the second DV, based on your selection in the first DV as the criteria.

I usually use the latter method. You can do this as a PARAMETER quuery.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Thanks Skip, I think I know what you mean about using OFFSET(), but could you give me an example please?

Here's a sample of my data from a Pivot Table:

Code:
[b]Fault           OCC[/b]
Switch Failure   3
Software	     3
	             7
	             8
Sticking	     5
Solenoid	     6
	             7
Wiring	       3

So, I use "Fault" as the DV list for column A, and "OCC" for column B. If I select Switch Failure in A2, I need B2 to read 3.
If I then select Software in A3, B3 should show a dropdown with 3, 7, 8 as the options.

How should that be done?

Chris

Someday I'll know what I'm donig...damn!

 

FIRST, your table is incomplete!
[tt]
Fault OCC

Switch Failure 3
Software 3
Software 7
Software 8
Sticking 5
Solenoid 6
Solenoid 7
Wiring 3
[/tt]
Then the DV List formula...
[tt]
=OFFSET($A$1,MATCH(SelectedFault,Fault,0),1,COUNTIF(Fault,SelectedFault),1)
[/tt]
assuming that your table starts in A1 on the same sheet and using Named Ranges.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top