regular expression for calc

Hi Brian
I wish i could say it did help but unfortunately not. It works with the whole cell contents but doesnt seem to pick out a word within the cell. For instance, one of my list has contents "X1 G43". Now if I have "X1 G43" in the cell Xn (using your example) i get count 1 returned which is correct; but if i have "X1" in cell Xn it returns 0, which is clearly wrong (at least as far as my requirements are concerned). And yes, i do have regular expressions enabled in Calc > Calculate. My version is 5.2.2.2 x64 and im using 64bit windows 7.

G.

Hi Gary,

find the option "Search criteria = and <> must apply to whole cells" in Tools > Options > Calc > Calculate. Try it with disabled option.

Kind regards
Regina

Gary Collins schrieb:

If the code you are looking for only occurs once per cell you could use
find() or search() against each cells to determine if the code is present
then countif() the results where greater than zero.

Did the OP get this working.
I have it working with
=COUNTIF(SEARCH("\b"&$G$37&"\b",E37:E39),">1")

$G$37 contains the search term with word boundaries.
E37:E39 is the range I am searching.

Enter into the cell where you want the answer =COUNTIF(SEARCH("\b"&$G$37&"\b",E37:E39),">1") and press CTL + SFT + Enter

Steve