By: Md. Shamim Reza

In reply to Joe.

Hi Joe,

Assume your example data table (with headers) starts from cell A1. The lower criteria range i.e 20 is in cell E2 and the upper criteria range i.e 30 in cell G2. Now enter the following formula in cell H2 to get the desired result.
=TEXTJOIN(",",TRUE,IF($B$2:$B$6>=$E$2,IF($B$2:$B$6<=$G$2,$C$2:$C$6,""),""))

You can change the criteria ranges as required. For example, change the lower criteria from 20 to 25 and the upper criteria from 30 to 35. This will give you the #OFLANES values for the range 25-35. You can create dropdown lists in the criteria cells E2 and G2 to easily change the criteria value.

I’ve also emailed you an excel document with the solution. Please check.

Don’t hesitate to let us know if you face any further problems. Thanks for reaching out to us.

Regards,
Md. Shamim Reza (ExcelDemy Team)