I am new to google sheets.
How do I loop over column C
and extract every occurence of Dog
and Mouse
together with its "index" A, C, D
into columns E
and F
?
The best thing I can do right now is extract the strings row by row with
=IFS($C:$C="Dog"; $B:$B;$C:$C="Mouse";$B:$B;1=1; "")
and
=IFS($C:$C="Dog"; $C:$C;$C:$C="Mouse";$C:$C;1=1; "")
but this leaves free spaces in the new columns:
See if this works
=filter(B3:C, regexmatch(C3:C, "Dog|Mouse"))
or, depending on your locale
=filter(B3:C; regexmatch(C3:C; "Dog|Mouse"))