[Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register]

Author Message
gemmalaming
Newbie

Joined: 13 Mar 2012
Posts: 3

 Posted: Tue Mar 13, 2012 2:37 pm    Post subject: Integer tally across cells Hi everyone. I used to know how to do this, but have forgotten. I cannot now find anything that can remind me. I would like to make a tally of the integers (1-9) across a given area of cells or an entire speradsheet. For example given the numbers 1234 5678 and 1324 I would like to know how often 1s and 2s occur. Can anyone tell me how to do this simply, please.
ken johnson
Super User

Joined: 23 Apr 2009
Posts: 2032
Location: Sydney, Australia

Posted: Tue Mar 13, 2012 4:04 pm    Post subject:

With 1234 in A1, 5678 in A2 and 1324 in A3 this formula returns a count of the 1s in A1:A3...
 Code: =SUMPRODUCT(LEN(A1:A3)-LEN(SUBSTITUTE(A1:A3;1;"")))
Similarly for the count of 2s...
 Code: =SUMPRODUCT(LEN(A1:A3)-LEN(SUBSTITUTE(A1:A3;2;"")))
Alternatively, this counts the digit you have entered in B1...
 Code: =SUMPRODUCT(LEN(A1:A3)-LEN(SUBSTITUTE(A1:A3;B1;"")))

Ken Johnson
_________________
gemmalaming
Newbie

Joined: 13 Mar 2012
Posts: 3

 Posted: Thu Mar 15, 2012 8:22 am    Post subject: Thanks Ken. I have tried it but it didn't like the LEN command. At present I am using a Dutch version of Calc. Could you please tell me what this command stands for and I might be able to find it in the commands in my system. Unless you happen to know the Dutch command of course Thanks for your response. Sorry for the late reply, I was flooded with some urgent translation work.
ken johnson
Super User

Joined: 23 Apr 2009
Posts: 2032
Location: Sydney, Australia

Posted: Thu Mar 15, 2012 12:54 pm    Post subject:

LEN (English) is LENGTE (Dutch).
Changing the other functions yields...
 Code: =SOMPRODUKT(LENGTE(A1:A3)-LENGTE(SUBSTITUEREN(A1:A3;1;""))) =SOMPRODUKT(LENGTE(A1:A3)-LENGTE(SUBSTITUEREN(A1:A3;2;""))) =SOMPRODUKT(LENGTE(A1:A3)-LENGTE(SUBSTITUEREN(A1:A3;B1;"")))

Ken Johnson
_________________
gemmalaming
Newbie

Joined: 13 Mar 2012
Posts: 3

 Posted: Thu Mar 15, 2012 1:45 pm    Post subject: Brilliant, Ken. I looked online to find this info, but to no avail. Obviously you have the keys to Calc! I will check out your ideas when I have a moment. Thankyou very much for your help. It is appreciated. Gemma
ken johnson
Super User

Joined: 23 Apr 2009
Posts: 2032
Location: Sydney, Australia

Posted: Thu Mar 15, 2012 4:30 pm    Post subject:

 gemmalaming wrote: I looked online to find this info, but to no avail. Obviously you have the keys to Calc!

I made this spreadsheet using an xl doc I found on the web...
http://www.mediafire.com/view/?qsv385vt06bj54n
You might find it useful for these situations.

Ken Johnson
_________________

Last edited by ken johnson on Mon Sep 24, 2012 5:13 am; edited 1 time in total
ozzie

Joined: 29 Jul 2010
Posts: 400
Location: victoria

 Posted: Thu Mar 15, 2012 7:35 pm    Post subject: open office - 30 odd languages - and the ability to add more. unfortunately i don't remember where i got it from but i would like to express my thanks to all involved http://www.mediafire.com/?dio0lfixoaozbig_________________If your problem has been solved please add "[Solved]" to the beginning of your first post title (edit button).
ken johnson
Super User

Joined: 23 Apr 2009
Posts: 2032
Location: Sydney, Australia

 Posted: Thu Mar 15, 2012 9:19 pm    Post subject: Thanks ozzie, looks good. Ken Johnson
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT - 8 Hours Page 1 of 1

 Jump to: Select a forum OpenOffice.org Forums----------------Setup and TroubleshootingOpenOffice.org WriterOpenOffice.org CalcOpenOffice.org ImpressOpenOffice.org DrawOpenOffice.org MathOpenOffice.org BaseOpenOffice.org Macros and APIOpenOffice.org Code Snippets Community Forums----------------General DiscussionSite Feedback
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum