I would like to automatically count the of times a certain item is mentioned in a list. Unfortunately, the list contains variant spelling of the item, which may or may not contain dashes and/or spacebars. Similarly, the name of the item may also contain similar variations. Therefore I want to apply SUBSTITUTE to replace all spaces and dashes with nothing, and compare the results. Having a separate column is impractical.
So I want something like this, and tried this and a couple of variations
=LET(
teamName, $A$105,
teamNameRange, $B$3:$B$102,
itemNameRange, $J$3:$J$102,
itemName, A108
sum, COUNTIFS(teamNameRange, teamName, SUBSTITUTE(itemNameRange,"-",""), SUBSTITUTE(itemName,"-","")),
sum
)
but of course that doesn’t work, likely because SUBSTITUTE does not naturally produce an array or something like that.
What is the proper way to do it?
vicky_molokh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.