conditional droplist INDIRECT()

merlin_the_magician

Active Member
Joined
Jul 31, 2002
Messages
480
I need help using droplist and INDRECT()



For construction work tenders, we would like the contractors to use equipment that has least environmental impact. We want to try this means of an incentive premium. Equipment that has less emissions is preferred.

I have built a worksheet that works the way I would like it to, but it is too complicated, really.



In an effort to make things more user-friendly, I have been experimenting with conditional droplists, using INDIRECT().

Users choose an equipment piece, the corresponding enige category and fuel.



This works, sort of… however very soon after starting this little experiment, I ran into 2 major problems.

  • Droplists are conditional, meaning one depends on the other. However, this only seems to work top-down, not bottom-up. That means users (accidentally or purposefully) may enter invalid combinations. Can I prevent this from happening? It appears cross-referencing conditional formatting is not possible.
  • Depending on the value chosen from the droplist, the next droplist should have limited choise. Practical thing in the EXAMPLE WORKSHEET I added: an electic vehicle should not use fuel.




Can anybody me with this please?



Oh…. prefer NOT to use macro’s. This will likely violate network-security standards.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
I don't think that it will be possible to make it work both ways without vba (macros), you could try this as the list formula for B5, it will only allow B5 to be changed if B6 and B7 are both empty.

=OFFSET(equipment,0,0,IF(AND($B$6="",$B$7=""),ROWS(equipment),0),1)

Similarly, for B6,

=OFFSET(INDIRECT(B5),0,0,IF($B$7="",ROWS(INDIRECT(B5)),0),1)

There might be a simpler way of doing it, but validation is very fussy with the formulas that it will accept.
 
Upvote 0
Hi Merlin_the_Magician,

Problem 1: The Data Validation Lists are data entry so won't change after you've made a selection. e.g. if you select small boat in B5 but then delete small boat from the equipment list in F10 it will still show small boat in B5.

Problem 2: Your Fuel Data List is fixed. To make it restricted to previous selections you'd need to build a separate fuel list from fuels which are valid for the contents of B5 and B6.
 
Upvote 0
It appears cross-referencing conditional formatting is not possible.
Would this Conditional Formatting help?

Here I had Tractor in B5 but changed it to small boat & the cells are highlighted indicating an error

merlin_exampledroplist.xlsx
AB
4
5Equipmentsmall boat
6Engine categoryStage 4 / Tier 4B (final)
7fuelRegular
8
Blad1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B7Expression=AND(B7<>"",B6="Electric")textNO
B5:B6Expression=AND(COUNTA(B$5:B$6)=2,ISNA(MATCH(B$6,INDIRECT(SUBSTITUTE(B$5," ","_")),0)))textNO



And if Electric is in B6 and anything in B7 it gets highlighted.

merlin_exampledroplist.xlsx
AB
4
5Equipment
6Engine categoryElectric
7fuelRegular
8
Blad1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B7Expression=AND(B7<>"",B6="Electric")textNO
B5:B6Expression=AND(COUNTA(B$5:B$6)=2,ISNA(MATCH(B$6,INDIRECT(SUBSTITUTE(B$5," ","_")),0)))textNO
 
Upvote 0
When posting my earlier reply, I hadn't noticed that 'Fuel' was not in a dependent list, to make that part work properly it would be best to create a second table for fuel types based on the engine in the same format as the engine category table, i.e.
Fuel category
geenLevel 2ElectricHydrogen
Bio-based dieselRegularElectricHydrogen
GTL
HVO
 
Upvote 0

Forum statistics

Threads
1,214,924
Messages
6,122,293
Members
449,077
Latest member
Rkmenon

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