Forum Discussion
Drop down list inside if statement
- bosinanderDec 29, 2021Iron Contributor
Yea_So Compared to
=IF(C7="termination";G3#;I3#)
your variant
=IF(Sheet1!C7="Termination";Sheet2!$A$1:$A$2;"")
works with older versions of Excel not supporting spill areas (#) and also moves the list items to a separate configuration sheet. I think it is a good setup, using a separate sheet for setup variables.
- bosinanderDec 29, 2021Iron Contributor
Hi Yea_So
It looks to be similar to Dec 08 2021 09:19 PM but coded to use two cells on another sheet instead of an array. Still shows an empty validation list when not 'termination', but it is a variant.
=IF(Sheet1!C7="Termination";Sheet2!$A$1:$A$2;"")
- Yea_SoDec 29, 2021Bronze Contributor
it's not based on two cells but just based on an if statement within the data validation. the other cell was just a test to make sure it works within the data validation and left it there for illustration purposes. I tend to lean towards a simplistic solution for the op to expedite their project.
VBA is a powerful solution for those who like to explore different types of solutions but for the ones asking for a formula based solution the maintainability is better since the current user might get promoted to another opportunity or move to a different company for a career change and someone else might inherit the spreadsheet who is not familiar or inclined to use VBA and has no idea how to maintain the solution or troubleshoot it in the future.
- bosinanderDec 30, 2021Iron Contributor> I tend to lean towards a simplistic solution for the op to expedite their project.
[x] Like