Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mac Mac is offline
external usenet poster
 
Posts: 213
Default Countif - extended functionality

Hello,
having a column in which data is entered like (1 line here denoted 1 cell)

1,14,17
2
3,8
12,14
14,14,17

the usual countif won't work, of course. How do I go about a formula such as
- "give me a count of all occurrences of the number 17 in the given range"?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Countif - extended functionality

If these are typed into a single cell then they will be treated as
text values, not numbers. You could use FIND or SEARCH to look for
"17" in each cell, but of course this will also find "173" and "317".

Hope this helps.

Pete

On May 14, 11:14*am, Mac wrote:
Hello,
having a column in which data is entered like (1 line here denoted 1 cell)

1,14,17
2
3,8
12,14
14,14,17

the usual countif won't work, of course. How do I go about a formula such as
- "give me a count of all occurrences of the number 17 in the given range"?


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Countif - extended functionality

={SUM(LEN("Range")-LEN(SUBSTITUTE("Range","17","")))/LEN("17")} : Array
Function (Ctrl +Shift + Enter)

"Mac" wrote:

Hello,
having a column in which data is entered like (1 line here denoted 1 cell)

1,14,17
2
3,8
12,14
14,14,17

the usual countif won't work, of course. How do I go about a formula such as
- "give me a count of all occurrences of the number 17 in the given range"?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 30
Default Countif - extended functionality

On May 14, 3:14 pm, Mac wrote:
Hello,
having a column in which data is entered like (1 line here denoted 1 cell)

1,14,17
2
3,8
12,14
14,14,17

the usual countif won't work, of course. How do I go about a formula such as
- "give me a count of all occurrences of the number 17 in the given range"?


=COUNTIF(A:A,"*17*")
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Countif - extended functionality

If the value to be counted will not be repeated within a cell (eg 17,17,17)
Try this:

With A1:A5 containing the following values....
1,14,17
17
117
17,10,20
12,17,55

This formula returns the count of "17"...
B1: =SUM(COUNTIF(A1:A5,{"17,*","17","*,17,*","*,17"}))

Using the sample data, that formula returns: 4
Note: 117 does NOT equal 17

Is that something you can work with?
Post back if you have more questions.
-------------------------------
Regards,

Ron
Microsoft MVP - Excel
(WinXP, Excel 2003)

"Mac" wrote in message
...
Hello,
having a column in which data is entered like (1 line here denoted 1 cell)

1,14,17
2
3,8
12,14
14,14,17

the usual countif won't work, of course. How do I go about a formula such
as
- "give me a count of all occurrences of the number 17 in the given
range"?




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Countif - extended functionality

=SUMPRODUCT((LEN(A1:A5)-LEN(SUBSTITUTE(A1:A5,"17",""))))/2


"Mac" wrote:

Hello,
having a column in which data is entered like (1 line here denoted 1 cell)

1,14,17
2
3,8
12,14
14,14,17

the usual countif won't work, of course. How do I go about a formula such as
- "give me a count of all occurrences of the number 17 in the given range"?

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Countif - extended functionality

I tried that to get the count of the number 1. It seems to count all the ones.

The formula result was 8. It should be 1.

What am I doing wrong? Here's the formula I used-
=SUMPRODUCT((LEN(A1:A5)-LEN(SUBSTITUTE(A1:A5,"1",""))))/1



"Teethless mama" wrote:

=SUMPRODUCT((LEN(A1:A5)-LEN(SUBSTITUTE(A1:A5,"17",""))))/2


"Mac" wrote:

Hello,
having a column in which data is entered like (1 line here denoted 1 cell)

1,14,17
2
3,8
12,14
14,14,17

the usual countif won't work, of course. How do I go about a formula such as
- "give me a count of all occurrences of the number 17 in the given range"?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
extended y-axix John Charts and Charting in Excel 1 January 14th 08 02:48 PM
extended List box Ken Williams New Users to Excel 7 November 11th 06 03:37 AM
Even more Complex COUNTIF functionality [email protected] Excel Worksheet Functions 6 September 21st 05 05:38 AM
extended selection jsermanexceluser Excel Discussion (Misc queries) 2 April 28th 05 09:08 PM
Geo mean extended Stephen Excel Worksheet Functions 0 January 18th 05 03:03 PM


All times are GMT +1. The time now is 04:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"