Forum Discussion
mawalz21
Mar 22, 2024Copper Contributor
Filtering non-numeric data
I have a table that is all words (specifically, it's a table listing typeface names), and I'd like to be able to filter it somehow based on custom properties I've assigned them. I can't figure out ho...
PeterBartholomew1
Mar 22, 2024Silver Contributor
The core of the answer is to compare the properties of the entire list of fonts against the requirement to obtain an array of TRUE/FALSE. These criteria are multiplied to give the combined AND condition used to filter the names. As a simple worksheet formula
= FILTER(name, (prop="Proportional") * (serif = "NonSerif"), "Not available")
Using LET and LAMBDA to separate the user input from the calculation
= LAMBDA(p,s,
LET(
criterion1, prop = p,
criterion2, serif = s,
FILTER(name, criterion1 * criterion2, "Not available"))
)("Proportional", "nonSerif")
Finally, hiding the 'workings' within a Named Lambda function
= FontFinder("NonProportional", )
"where"
FontFinder
= LAMBDA([p],[s],
LET(
criterion1, IF(ISOMITTED(p), TRUE, prop=p),
criterion2, IF(ISOMITTED(s), TRUE, serif=s),
FILTER(name, criterion1 * criterion2, "Not available")
)
)
Get off wherever you feel comfortable, but the key is to start the journey.