I am trying to create a dynamic dropdown based on two matches. If A=F and B=G then validate C with H.
I tried to use the following, but am getting an error:
=OFFSET(F2,MATCH(A3:B3,F3:G15,0),1,COUNTIF(F3:G15,A3:B3),1)
Thanks gurus!
I am trying to create a dynamic dropdown based on two matches. If A=F and B=G then validate C with H.
I tried to use the following, but am getting an error:
=OFFSET(F2,MATCH(A3:B3,F3:G15,0),1,COUNTIF(F3:G15,A3:B3),1)
Thanks gurus!
Like this?
=FILTER(H3:H15,(F3:F15=A3)*(G3:G15=B3)) (say this formula is in cell C13)
You can then reference the output in the data validation list for the dropdown via =C13#
Thanks RaulSerg! I don't have Filter as a valid function. Help indicates it is only available to Microsoft 365 subscribers in the Monthly Channel. Is there another option for those of us who can't access this function?
You can try this, enter as array with Ctrl+Shift+Enter and then copy down as far as necessary
=INDEX(H$3:H$15,SMALL(IF((G$3:G$15=$B$3)*($A$3=F$3:F$15),ROW(H$3:H$15)-ROW(H$3)+1,""),ROWS(F21:F$21)))
You can wrap around IFERROR if required.
You can use the result range then in data validation.
If you need it to be dynamic (expanding range), you will need to create a name with a dynamic range with either OFFSET or INDEX.
In my case the function is entered in F21 which is why I use the mixed reference F21:F$21 as anchor in the last range.
Regards
Thanks RaulSerg!
I need a dynamic range and tried to add this with OFFSET and COUNTIF but am not having any luck:
=OFFSET(H2,INDEX(H$3:H$15,SMALL(IF((G$3:G$15=$B$3)*($A$3=F$3:F$15),ROW(H$3:H$15)-ROW(H$3)+1,""),ROWS(C3:C$3))),1,COUNTIF(H3:H15,C3),1)
Any suggestions?
Just count the outcomes and put it into a range name.
I eleminated the errors via e.g.: =IFERROR(INDEX(H$3:H$15,SMALL(IF((G$3:G$15=$B$3)*($A$3=F$3:F$15),ROW(H$3:H$15)-ROW(H$3)+1,""),ROWS(F21:F$21))),"")
Then create a range name, e.g. 'DynamicRange', Refers To: =OFFSET(Sheet1!$F$21,,,COUNTA(Sheet1!E21:E30)-COUNTBLANK(Sheet1!E21:E30))
The Range E21:E30 is arbitrary but long enough to capture the max number of outcomes.
Then put the range name into Data Validation, List, Source =DynamicRange
Regards
Use this:
![]()
Please Login or Register to view this content.
Quang PT
If the data is shuffled, this formula might fail though.
E.g. all the values that OFFSET combines need to be a contiguous range in the original data set.
Last edited by AliGW; 05-23-2020 at 03:11 AM. Reason: Please don't quote unnecessarily!
Thank you RaulSerg! That worked!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks