I need a formula that will check if the text in a cell contains the text "bio", anywhere in the text, and return a 1 if it does, and a 0 if it doesn't
is this something that is possible?
[Solved] If "specific text" exists, then 1, else 0
-
alienrobotghost
- Posts: 16
- Joined: Thu Jun 25, 2020 10:01 am
[Solved] If "specific text" exists, then 1, else 0
Last edited by alienrobotghost on Thu Jan 09, 2025 6:26 am, edited 1 time in total.
openoffice 4.1.1 on windows 7
Re: if "specific text" exists, then 1, else 0
Yes. One way would be to use the FIND() function wrapped in an IF().
Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2.3.2; SlackBuild for 26.2.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
Apache OpenOffice 4.1.16
LibreOffice 26.2.3.2; SlackBuild for 26.2.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
-
alienrobotghost
- Posts: 16
- Joined: Thu Jun 25, 2020 10:01 am
Re: if "specific text" exists, then 1, else 0
I tried that... and failed miserably... lol
openoffice 4.1.1 on windows 7
Re: If "specific text" exists, then 1, else 0
What exactly did you try? And what was the result?
| Edit: You'll need an ISERR() in there as well. |
Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2.3.2; SlackBuild for 26.2.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
Apache OpenOffice 4.1.16
LibreOffice 26.2.3.2; SlackBuild for 26.2.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
Re: If "specific text" exists, then 1, else 0
Assume column $A contains the strings. You will get the numeric results you mentioned to indicate the presence of the substring "bio" by
The makes Calc format the result cell to "Number / General" automatically.
If you prefer to get the results formatted automatically as Boolean (logical) use
If you want a case insensitive formula use
and respectively.
Code: Select all
= 0 + ISNUMBER(FIND("bio"; $A1))Code: Select all
0+If you prefer to get the results formatted automatically as Boolean (logical) use
Code: Select all
= ISNUMBER(FIND("bio"; $A1))Code: Select all
= 0 + ISNUMBER(FIND(UPPER(substring); UPPER($A1)))
Last edited by Lupp on Wed Jan 08, 2025 4:17 pm, edited 1 time in total.
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
- MrProgrammer
- Moderator
- Posts: 5430
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: If "specific text" exists, then 1, else 0
=N(SUBSTITUTE(cell;"bio";"")<>cell)alienrobotghost wrote: ↑Wed Jan 08, 2025 8:30 am I need a formula that will check if the text in a cell contains the text "bio", anywhere in the text, and return a 1 if it does, and a 0 if it doesn't
If this solved your problem please go to your first post use the Edit ✏️ button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.
[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
-
alienrobotghost
- Posts: 16
- Joined: Thu Jun 25, 2020 10:01 am
Re: If "specific text" exists, then 1, else 0
You guys are the best!!!
openoffice 4.1.1 on windows 7