[Solved] Count non-empty cells in a row

Discuss the spreadsheet application
Post Reply
HowardJ
Posts: 126
Joined: Thu Aug 01, 2013 1:49 am
Location: Newfoundland

[Solved] Count non-empty cells in a row

Post by HowardJ »

I have a spreadsheet that records whether or not an event may have occurred by date. The entry may be either a number or text. I want to sum the number of times an event has occurred for a particular period.

The following works:- =(C6<>"")+(D6<>"")+(E6<>"") etc. etc. There are a lot more rows and this is cumbersome and inelegant.

Is there a smarter way to sum over a range?
Last edited by RoryOF on Sun Oct 20, 2019 4:29 pm, edited 2 times in total.
AOO 4.1.14
on various machines running PCLinuxOS (KDE desktop). It all began with StarOffice 5.2 - I've still got the disk!
User avatar
Zizi64
Volunteer
Posts: 11362
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Counting non-empty cells in a row.

Post by Zizi64 »

Use the function COUNT() for counting numeric contents, or the COUNTA() for any contents referenced to the desired cell range.

Code: Select all

=COUNT(C6:E6)
Last edited by Zizi64 on Sun Oct 20, 2019 4:20 pm, edited 1 time in total.
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.
HowardJ
Posts: 126
Joined: Thu Aug 01, 2013 1:49 am
Location: Newfoundland

Re: Counting non-empty cells in a row. SOLVED

Post by HowardJ »

Thank. I just found those commands myself - should have looked first!
AOO 4.1.14
on various machines running PCLinuxOS (KDE desktop). It all began with StarOffice 5.2 - I've still got the disk!
Post Reply