Dependent Validation/Count/Match Problem

josterma

New Member
Joined
Nov 14, 2003
Messages
39
Good evening,

In the format below I'm trying to do the following based on the items that a user would select from the Validation lists at left. For example, if a user were to select just "Joe" from the People list and leave the other 2 lists blank, the "Count" column would return the values for each item that "Joe" is associated with - so it would show 1 Joe, 1 Zebra and 1 Apple and zero on everything else. If a user selects Steve, the count column would show 2 Steve, 1 dog, 1 zebra, 1 apple and 1 banana and the rest zeros. If a user selects, Steve and Zebra the column would show 1 Steve, 1 zebra and 1 banana and the rest zeros. If the user were to just select "Orange" from the fruit list, the column would show 1 Bob, 1 elephant and 1 orange. If a user were not to select any values from the lists, every item in the data set would be counted (since nothing is being restricted based on the validation lists).

My goal in formatting the data this way is to link a series of pie charts that will enable end users in our org to graphically see the distribution of various categories based on the user-defined variables they select. So if they wanted to see what Steve prefers for animals and fruit, they would see that 50% of the time it's dogs, 50% zebras, 50% apples and 50% bananas. If they wanted to see what Steve and his Dog prefer they would see that 100% of time it's an apple. I will have about 1000 rows of data in this format.

My macro writing is poor so any formula suggestions would be most welcome. Thanks in advance for your insights!

Regards,
Jeff
Book1
ABCDEFGHI
1
2
3Validation ListsData SetCount
4PeopleAnimalsFruitPeople
5PeopleJoeZebraAppleJoe
6JoeSteveDogAppleSteve
7SteveSteveZebraBananaBob
8BobBobElephantOrange
9Animals
10AnimalsZebra
11ZebraElephant
12ElephantDog
13Dog
14Fruit
15FruitApple
16AppleBanana
17BananaOrange
18Orange
19
20
21
22
23
Sheet1
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hello,

I think I may have 1 solution to your problem: if I understood everythin properly.

For this to work you will have to add 3 extra columns that in fact are exact copies of the one they point 2. This is because using pivot table there is some limitations.

So in orange is the data with 3 last columns with formula
=a1
=b1
=c1....etc just to have the exact copy

Not sure if you know at to use a pivot.
However to Data .... Pivot Table.... Select Excel list.. then you can select pivot chart with pivot table...
In the first select only pivot table, so you can see how it works
Then select the orange data at the top as source

On the pivot, At the top, in the drop page field drop the heading as in [using the toolbar pivot table drop field, icon on the far right]
In the column field drop the fruit2 field
In the row field drop People 2 and animal 2 field

In the data field you will drop the the people 2 and select in the fields settings function count and choose option % of total.
If the row and columns total don't show as in my sample you may need to enable them by clicking anywhere in the pivot and clicking table options : grand total for rows and grand total for columns.

Then it all should look something like that:
Book1
ABCDEF
1PeopleAnimalFruitPeopleAnimalFruit
2JoeZebraAppleJoeZebraApple
3SteveDogAppleSteveDogApple
4SteveDogPearSteveDogPear
5SteveLeopardstrawberriesSteveLeopardstrawberries
6SteveDogstrawberriesSteveDogstrawberries
7BobElephantOrangeBobElephantOrange
8JoeElephantOrangeJoeElephantOrange
9JeffZebraAppleJeffZebraApple
10JeffZebraBananaJeffZebraBanana
11
12
13PeopleSteve
14Animal(All)
15Fruit(All)
16
17_PersonFruit2
18People2Animal2ApplestrawberriesPear_Animal
19SteveDog25.00%25.00%25.00%75.00%
20Leopard0.00%25.00%0.00%25.00%
21_Animal25.00%50.00%25.00%100.00%
Sheet2
 
Upvote 0
Thanks!

Thanks for the great solution! I had to make a few tweaks to get to the final output I was looking for but your pivot table suggestion got me 99% of the way there.

Best Regards,
Jeff
 
Upvote 0

Forum statistics

Threads
1,216,117
Messages
6,128,935
Members
449,480
Latest member
yesitisasport

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