Hi,
I am trying to search content in several cells (their info changes based on another cell) and would like to replace the original text with 1 [EDIT: or any other number other than 0] if the word is found and 0 if the word is not found. These numbers are then summed together. It's rough for me to put into words so I am attaching a sheet.
Any help would be greatly appreciated.
[Solved] Search and Replace Text
-
- Posts: 28
- Joined: Sun Jan 31, 2016 6:44 am
[Solved] Search and Replace Text
Last edited by Moon Lit Nights on Mon Apr 08, 2019 4:41 pm, edited 1 time in total.
OpenOffice 3.1 on Windows
Re: Search and Replace Text
You can use a formula like
or
FIND() is case sensitive, SEARCH() is not.
These will return TRUE or FALSE. You can format the cells as integer numbers if you want to see 1 and 0 instead of TRUE and FALSE. TRUE has a value of 1 and FALSE has a value of 0, so the sum will work in either case.
Code: Select all
=NOT(ISERROR(FIND("Hello";$B2)))
Code: Select all
=NOT(ISERROR(SEARCH("Hello";$B2)))
These will return TRUE or FALSE. You can format the cells as integer numbers if you want to see 1 and 0 instead of TRUE and FALSE. TRUE has a value of 1 and FALSE has a value of 0, so the sum will work in either case.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
-
- Posts: 28
- Joined: Sun Jan 31, 2016 6:44 am