How can I exclude blank cells from from INDEX COLLECT criteria?

Options

Hello,

I've got a sheet with over 13,000 rows. My goal is to have end users enter "search criteria" into several cells to narrow the list to a handful of options. The criteria will be Speaker First Name, Speaker Last Name, Specialty, and State.

So far, I've been able to pull the information from my source sheet based on the criteria, but the end users may not have all four pieces of criteria.

Is there a way I can modify my formula to filter my results as long as at least one piece of data is entered in the criteria cells?

Current Formula:

=IFERROR(IF([Speaker First Name]$1 <> "", INDEX(DISTINCT(COLLECT({AttendeesConcat},{AttendeeFN}, {AttendeeFN} = [Speaker First Name]$1)), [Primary Column]@row), IF([Speaker Last Name]$1 <> "", INDEX(DISTINCT(COLLECT({AttendeesConcat}, {AttendeeLN}, {AttendeeLN} = [Speaker First Name]$1)), [Primary Column]@row), IF(Specialty$1 <> "", INDEX(DISTINCT(COLLECT({AttendeesConcat}, {Specialty}, {Specialty} = Specialty$1)), [Primary Column]@row), IF(State$1 <> "", INDEX(DISTINCT(COLLECT({AttendeesConcat},{State}, {State} = State$1)), [Primary Column]@row))))), ")

This formula works if I only need to evaluate one criteria cell at a time, but doesn't have the waterfall effect I'm looking for.

Any advice would be greatly appreciated!!

The "search" criteria will be entered in the highlighted cells.

Screenshot 2023-08-21 154719.jpg


Best Answer

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!