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

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I forgot to mention: all cells contain formula, since they refer from another list. Therefore, I was using the match function to find the empty cell, instead of using counta function.
 
Upvote 0
If you set it up with a dynamic array formula that excludes blanks, you could put something like "='Lists2'!$B$12#"
 
Upvote 0
If you set it up with a dynamic array formula that excludes blanks, you could put something like "='Lists2'!$B$12#"

Hi jaeiow, thank you for your response. Would you mind to explain that a bit more? Where would you use the part you shared: "='Lists2'!$B$12#"?
 
Upvote 0
Maybe this?

=OFFSET(Lists2!$B$11,1,MATCH($B$2,Lists2!$B$11:$N$11,0)-1,SUMPRODUCT((OFFSET(Lists2!$B$11,1,MATCH($B$2,Lists2!$B$11:$N$11,0)-1,10,1)<>"")*1),1)
 
Upvote 0
Solution
Maybe this?

=OFFSET(Lists2!$B$11,1,MATCH($B$2,Lists2!$B$11:$N$11,0)-1,SUMPRODUCT((OFFSET(Lists2!$B$11,1,MATCH($B$2,Lists2!$B$11:$N$11,0)-1,10,1)<>"")*1),1)

Hi kevin, thank you! Unfortunately the formula is not working at all for me :(
 
Upvote 0
Hi kevin, thank you! Unfortunately the formula is not working at all for me :(
I've just noticed that your regional settings use semicolons rather than commas for delimiters. Give this a try instead:

=OFFSET(Lists2!$B$11;1;MATCH($B$2;Lists2!$B$11:$N$11;0)-1;SUMPRODUCT((OFFSET(Lists2!$B$11;1;MATCH($B$2;Lists2!$B$11:$N$11,0)-1;10;1)<>"")*1);1)
 
Upvote 0
I've just noticed that your regional settings use semicolons rather than commas for delimiters. Give this a try instead:

=OFFSET(Lists2!$B$11;1;MATCH($B$2;Lists2!$B$11:$N$11;0)-1;SUMPRODUCT((OFFSET(Lists2!$B$11;1;MATCH($B$2;Lists2!$B$11:$N$11,0)-1;10;1)<>"")*1);1)
I had replaced the comas with semicolons already, but I just get #N/A
 
Upvote 0
I had replaced the comas with semicolons already, but I just get #N/A
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 ;)
 
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,639
Members
449,093
Latest member
Ahmad123098

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