[Solved] Unable to get COUNTIF to work

Discuss the spreadsheet application
Post Reply
dobrphi
Posts: 18
Joined: Fri Apr 30, 2010 11:53 pm

[Solved] Unable to get COUNTIF to work

Post by dobrphi »

I want 2 different counts on the contents in column A. The first is a total count of occurances and that works well. I want the second count to not include any entry in column A that ends in an "X". My counts should be 4 and 2. Could someone lend a hand please?
Attachments
Test 1 monthly partial.ods
(13.19 KiB) Downloaded 8 times
Last edited by dobrphi on Sun Jul 13, 2025 3:12 am, edited 1 time in total.
Windows 10
AOO 4.1.15
Alex1
Volunteer
Posts: 830
Joined: Fri Feb 26, 2010 1:00 pm
Location: Netherlands

Re: Unable to get countif to work

Post by Alex1 »

That's not how regular expressions work. Try

Code: Select all

=COUNTIF(A2:A5;".*X")
The dates without X are stored numerically. The dates with X are stored as text because they are not recognized as dates. You can see the difference by typing Ctrl+F8: numbers are blue, text is black, formulas are green. It's better to put the X's in a separate column.
AOO 4.1.15 & LO 24.8.4 on Windows 10
dobrphi
Posts: 18
Joined: Fri Apr 30, 2010 11:53 pm

Re: Unable to get countif to work

Post by dobrphi »

Thank you Alex1. I changed the column format from date to text. Your suggestion worked on the change.
Windows 10
AOO 4.1.15
Post Reply