PC Review


Reply
Thread Tools Rate Thread

Conditional validation with only two columns

 
 
Colin
Guest
Posts: n/a
 
      24th Feb 2009
Hi

I want to be able to have two drop down lists using the data below. If I
select Dog, the second list must present me with Meat and Bones. If I select
Cat, the second list must present me with Meat.

I cannot use named ranged by splitting the columns into Dog Food, Cat Food,
Cow Food etc... They must be in this two-column associated structure.

A B
Dog Meat
Dog Bones
Cat Meat
Cow Grass

Thanks,
Colin
 
Reply With Quote
 
 
 
 
T. Valko
Guest
Posts: n/a
 
      24th Feb 2009
Try this...

Assume your first drop down is in cell D1.

As the sorce for the dependent drop down use:

=OFFSET(B1,MATCH(D1,A:A,0)-1,,COUNTIF(A:A,D1))

--
Biff
Microsoft Excel MVP


"Colin" <(E-Mail Removed)> wrote in message
news:0A02F304-FCE0-4A70-B8F0-(E-Mail Removed)...
> Hi
>
> I want to be able to have two drop down lists using the data below. If I
> select Dog, the second list must present me with Meat and Bones. If I
> select
> Cat, the second list must present me with Meat.
>
> I cannot use named ranged by splitting the columns into Dog Food, Cat
> Food,
> Cow Food etc... They must be in this two-column associated structure.
>
> A B
> Dog Meat
> Dog Bones
> Cat Meat
> Cow Grass
>
> Thanks,
> Colin



 
Reply With Quote
 
Shane Devenshire
Guest
Posts: n/a
 
      24th Feb 2009
Hi,

Here is a different method that violates your rule of no name and only 2
lists.

In another sheet create the following ranges
A B C D
List Dog Cow Cat
Dog Meat Grass Meat
Cat Bones
Cow

The top row represents the name to be given to each list. Select A2:A4 and
name it List, select B2:B3 and name it Dog and so on.

Back on the first sheet select cell A1 and choose Data, Validation, List,
and in the source box enter =List

Select cell B1 and choose Data, Validation, List, and in the source box
enter =OFFSET(A1)

You did not explain why you could not use range names.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Colin" wrote:

> Hi
>
> I want to be able to have two drop down lists using the data below. If I
> select Dog, the second list must present me with Meat and Bones. If I select
> Cat, the second list must present me with Meat.
>
> I cannot use named ranged by splitting the columns into Dog Food, Cat Food,
> Cow Food etc... They must be in this two-column associated structure.
>
> A B
> Dog Meat
> Dog Bones
> Cat Meat
> Cow Grass
>
> Thanks,
> Colin

 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      25th Feb 2009
>enter =OFFSET(A1)

That won't work. Try it like this:

=INDIRECT(A1)

Quality trumps quantity ever time.

--
Biff
Microsoft Excel MVP


"Shane Devenshire" <(E-Mail Removed)> wrote in
message news:79A1B45A-0CAE-484B-AB8C-(E-Mail Removed)...
> Hi,
>
> Here is a different method that violates your rule of no name and only 2
> lists.
>
> In another sheet create the following ranges
> A B C D
> List Dog Cow Cat
> Dog Meat Grass Meat
> Cat Bones
> Cow
>
> The top row represents the name to be given to each list. Select A2:A4
> and
> name it List, select B2:B3 and name it Dog and so on.
>
> Back on the first sheet select cell A1 and choose Data, Validation, List,
> and in the source box enter =List
>
> Select cell B1 and choose Data, Validation, List, and in the source box
> enter =OFFSET(A1)
>
> You did not explain why you could not use range names.
>
> --
> If this helps, please click the Yes button
>
> Cheers,
> Shane Devenshire
>
>
> "Colin" wrote:
>
>> Hi
>>
>> I want to be able to have two drop down lists using the data below. If I
>> select Dog, the second list must present me with Meat and Bones. If I
>> select
>> Cat, the second list must present me with Meat.
>>
>> I cannot use named ranged by splitting the columns into Dog Food, Cat
>> Food,
>> Cow Food etc... They must be in this two-column associated structure.
>>
>> A B
>> Dog Meat
>> Dog Bones
>> Cat Meat
>> Cow Grass
>>
>> Thanks,
>> Colin



 
Reply With Quote
 
Colin
Guest
Posts: n/a
 
      26th Feb 2009
Thanks Bill. That works Also note this relies on the columns being sorted
by A then B but that is fine for me.

"T. Valko" wrote:

> >enter =OFFSET(A1)

>
> That won't work. Try it like this:
>
> =INDIRECT(A1)
>
> Quality trumps quantity ever time.
>
> --
> Biff
> Microsoft Excel MVP
>
>
> "Shane Devenshire" <(E-Mail Removed)> wrote in
> message news:79A1B45A-0CAE-484B-AB8C-(E-Mail Removed)...
> > Hi,
> >
> > Here is a different method that violates your rule of no name and only 2
> > lists.
> >
> > In another sheet create the following ranges
> > A B C D
> > List Dog Cow Cat
> > Dog Meat Grass Meat
> > Cat Bones
> > Cow
> >
> > The top row represents the name to be given to each list. Select A2:A4
> > and
> > name it List, select B2:B3 and name it Dog and so on.
> >
> > Back on the first sheet select cell A1 and choose Data, Validation, List,
> > and in the source box enter =List
> >
> > Select cell B1 and choose Data, Validation, List, and in the source box
> > enter =OFFSET(A1)
> >
> > You did not explain why you could not use range names.
> >
> > --
> > If this helps, please click the Yes button
> >
> > Cheers,
> > Shane Devenshire
> >
> >
> > "Colin" wrote:
> >
> >> Hi
> >>
> >> I want to be able to have two drop down lists using the data below. If I
> >> select Dog, the second list must present me with Meat and Bones. If I
> >> select
> >> Cat, the second list must present me with Meat.
> >>
> >> I cannot use named ranged by splitting the columns into Dog Food, Cat
> >> Food,
> >> Cow Food etc... They must be in this two-column associated structure.
> >>
> >> A B
> >> Dog Meat
> >> Dog Bones
> >> Cat Meat
> >> Cow Grass
> >>
> >> Thanks,
> >> Colin

>
>
>

 
Reply With Quote
 
Colin
Guest
Posts: n/a
 
      26th Feb 2009
Thanks Bill that worked Note that this relies on the columns being sorted
by A then B but thats fine for me.

"T. Valko" wrote:

> Try this...
>
> Assume your first drop down is in cell D1.
>
> As the sorce for the dependent drop down use:
>
> =OFFSET(B1,MATCH(D1,A:A,0)-1,,COUNTIF(A:A,D1))
>
> --
> Biff
> Microsoft Excel MVP
>
>
> "Colin" <(E-Mail Removed)> wrote in message
> news:0A02F304-FCE0-4A70-B8F0-(E-Mail Removed)...
> > Hi
> >
> > I want to be able to have two drop down lists using the data below. If I
> > select Dog, the second list must present me with Meat and Bones. If I
> > select
> > Cat, the second list must present me with Meat.
> >
> > I cannot use named ranged by splitting the columns into Dog Food, Cat
> > Food,
> > Cow Food etc... They must be in this two-column associated structure.
> >
> > A B
> > Dog Meat
> > Dog Bones
> > Cat Meat
> > Cow Grass
> >
> > Thanks,
> > Colin

>
>
>

 
Reply With Quote
 
Colin
Guest
Posts: n/a
 
      26th Feb 2009
Thanks Shane. I am aware of that method but in my actual sheet I may end up
having about 600 of those, so I wanted a cleaner method rather than create
600 names ranges!

Cheers,
Colin

"Shane Devenshire" wrote:

> Hi,
>
> Here is a different method that violates your rule of no name and only 2
> lists.
>
> In another sheet create the following ranges
> A B C D
> List Dog Cow Cat
> Dog Meat Grass Meat
> Cat Bones
> Cow
>
> The top row represents the name to be given to each list. Select A2:A4 and
> name it List, select B2:B3 and name it Dog and so on.
>
> Back on the first sheet select cell A1 and choose Data, Validation, List,
> and in the source box enter =List
>
> Select cell B1 and choose Data, Validation, List, and in the source box
> enter =OFFSET(A1)
>
> You did not explain why you could not use range names.
>
> --
> If this helps, please click the Yes button
>
> Cheers,
> Shane Devenshire
>
>
> "Colin" wrote:
>
> > Hi
> >
> > I want to be able to have two drop down lists using the data below. If I
> > select Dog, the second list must present me with Meat and Bones. If I select
> > Cat, the second list must present me with Meat.
> >
> > I cannot use named ranged by splitting the columns into Dog Food, Cat Food,
> > Cow Food etc... They must be in this two-column associated structure.
> >
> > A B
> > Dog Meat
> > Dog Bones
> > Cat Meat
> > Cow Grass
> >
> > Thanks,
> > Colin

 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      26th Feb 2009
You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Colin" <(E-Mail Removed)> wrote in message
news:B557ACB4-E161-465F-BF1E-(E-Mail Removed)...
> Thanks Bill that worked Note that this relies on the columns being
> sorted
> by A then B but thats fine for me.
>
> "T. Valko" wrote:
>
>> Try this...
>>
>> Assume your first drop down is in cell D1.
>>
>> As the sorce for the dependent drop down use:
>>
>> =OFFSET(B1,MATCH(D1,A:A,0)-1,,COUNTIF(A:A,D1))
>>
>> --
>> Biff
>> Microsoft Excel MVP
>>
>>
>> "Colin" <(E-Mail Removed)> wrote in message
>> news:0A02F304-FCE0-4A70-B8F0-(E-Mail Removed)...
>> > Hi
>> >
>> > I want to be able to have two drop down lists using the data below. If
>> > I
>> > select Dog, the second list must present me with Meat and Bones. If I
>> > select
>> > Cat, the second list must present me with Meat.
>> >
>> > I cannot use named ranged by splitting the columns into Dog Food, Cat
>> > Food,
>> > Cow Food etc... They must be in this two-column associated structure.
>> >
>> > A B
>> > Dog Meat
>> > Dog Bones
>> > Cat Meat
>> > Cow Grass
>> >
>> > Thanks,
>> > Colin

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional validation? PayeDoc Microsoft Excel Discussion 9 11th Nov 2009 02:50 PM
Re: conditional validation stefan onken Microsoft Excel Programming 1 10th Jun 2008 08:27 AM
Conditional validation Les Isaacs Microsoft Excel Discussion 14 24th Oct 2007 02:45 PM
Conditional Validation mojoshenpo Microsoft Excel Worksheet Functions 3 29th Jul 2006 08:46 PM
Conditional Validation mattmclaughlin@gmail.com Microsoft Excel Discussion 3 2nd May 2006 01:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:01 PM.