[Dropped] This simplest of formulas does not work

Discuss the spreadsheet application
Post Reply
CaliRay
Posts: 71
Joined: Sun Apr 26, 2009 6:20 pm

[Dropped] This simplest of formulas does not work

Post by CaliRay »

Code: Select all

=COUNTIF(J2:J37;'Sheep')
this one does not work either

Code: Select all

=COUNTIF(J2:J37;"Sheep")
The cells in the range are formatted as text and the formula is copied directly from the tutorial page for COUNTIF, replacing the range and target with my own values.

I also checked settings and unchecked case sensitive. Screenshot attached.
Attachments
countif settings.jpg
Last edited by MrProgrammer on Sun Jul 24, 2022 11:29 pm, edited 1 time in total.
Reason: Dropped: No attachment provided when requested -- MrProgrammer, forum moderator
OOo 4.1.3 on Windows 10 Home
User avatar
robleyd
Moderator
Posts: 5087
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: This simplest of formulas does not work

Post by robleyd »

A quick test suggests that it will work for me; perhaps you could upload a sample .ods file that shows the problem you are having. Without an example, we are guessing.

One guess - you have trailing spaces in the search range.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: This simplest of formulas does not work

Post by RoryOF »

Attached is my example, which works OK when I use " delimiters about the search term.
 Edit: Check that you are using straight quotes, not curly quotes. 
Attachments
CountIf_test.ods
(8.05 KiB) Downloaded 98 times
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: This simplest of formulas does not work

Post by Villeroy »

The most likely reason is that there is no cell value "Sheep" but "Sheep " or " Sheep" with white space.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
njhub
Posts: 33
Joined: Thu May 17, 2018 8:36 am
Location: Mayotte YT

Re: This simplest of formulas does not work

Post by njhub »

Try with :

Code: Select all

=COUNTIF(J2:J37,"*Sheep*")
LibreOffice (fr_YT): 6.1.4.2 (26/12/2018)
OS : Windows 10.0
User avatar
Zizi64
Volunteer
Posts: 11362
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: This simplest of formulas does not work

Post by Zizi64 »

CaliRay, please upload your ODF type sample file here.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: This simplest of formulas does not work

Post by Villeroy »

njhub wrote:Try with :

Code: Select all

=COUNTIF(J2:J37,"*Sheep*")
CaliRay uses OpenOffice.
OpenOffice supports regular expressions but no wildcards.
OpenOffice does not support comma as list separator.
-----------------
A simple solution: Disable "Search criteria ... match whole cell" In the calculation options.
Another solution: Enable regular expressions in formulas and use them like this: =COUNTIF(J2:J37,".*Sheep.*")
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply