Conditional data validation with variable list length

Pepess

New Member
Joined
Sep 19, 2021
Messages
10
Office Version
  1. 2010
Platform
  1. Windows
Hello,

I have a conditional drop down list (column C: Category) which depends from column B: Transaction type.
The lists for the data validation of both columns is variable, i.e. elements can be added or deleted from the list according to necessity.

For transaction type I can add up to 13 elements in my list and it works without showing up blanks in case there are less than 13 elements. Here's the formula as reference:
=OFFSET(Lists2!$B$11;0;0;1;IFERROR(MATCH("";Lists2!$B$11:$N$11;0)-1;13))

Now I need to make the category drop down list "dynamic" so that up to 10 elements can be added in the list, but if there are less, no blanks are beeing shown. I've been trying with this formula but doesn't work as I want and need some help to come further:
=OFFSET(Lists2!$B$11;1;MATCH($B2;Lists2!$B$11:$N$11;0)-1;IFERROR(MATCH("";Lists2!$B$12:$N$21;0)-1;10);1)

A screenshot of the lists for the data validation is attached.

I really appreciate your support, thanks in advance!
 

Attachments

  • 1661696935839.png
    1661696935839.png
    14.9 KB · Views: 11
  • lists.JPG
    lists.JPG
    83.8 KB · Views: 10
The #N/A error usually means that the formula can't find a referenced value. When I set up a test data set, I set the validation list for cell B2 as the range $B$11:$N$11 on the sheet called "Lists2". Is yours exactly the same? A sample of your actual data would be a big help ;)

Apologies, it works perfectly!!! :D Many many thanks! have a great day!
Admins: the thread can be marked as solved.
 
Upvote 0

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Apologies, it works perfectly!!! :D Many many thanks! have a great day!
Admins: the thread can be marked as solved.
You're more than welcome, just glad we got there in the end :)
(I think you mark the answer as a solution yourself?)
 
Upvote 0

Forum statistics

Threads
1,214,972
Messages
6,122,530
Members
449,088
Latest member
RandomExceller01

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