Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 153
Default COUNTIF in a range (and parts of cells)

Hello,

I've got a row of numbers as shown below. I need to count the number
of times a particular number shows up in this column range. But, if I
do the usual COUNTIF, I don't get the proper number. I've tried
=COUNTIF(A1:A10,"147"), but only come up with 2. I need an answer of
6. Any help would be greatly appreciated.

147
148
147
147,150
145,146
147,147
142
143,147
140
136
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default COUNTIF in a range (and parts of cells)

Use B1 to hold your criteria (147),
Then try this:

=SUMPRODUCT(LEN(A1:A10)-LEN(SUBSTITUTE(A1:A10,B1,"")))/LEN(B1)

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Phrank" wrote in message
...
Hello,

I've got a row of numbers as shown below. I need to count the number
of times a particular number shows up in this column range. But, if I
do the usual COUNTIF, I don't get the proper number. I've tried
=COUNTIF(A1:A10,"147"), but only come up with 2. I need an answer of
6. Any help would be greatly appreciated.

147
148
147
147,150
145,146
147,147
142
143,147
140
136


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 605
Default COUNTIF in a range (and parts of cells)

Hi RD,

Thanks for the formula. I learned something similar the other day - counting "a" in a string. Glad you use SUMPRODUCT instead of SUM and CSE.

The only way that the original poster can use COUNTIF is when he/she does "text to columns" first. I tried it on the data set posted and it worked. Don't know the arrangement of all data to tell if it will work.

Any comments?

Epinn

"RagDyer" wrote in message ...
Use B1 to hold your criteria (147),
Then try this:

=SUMPRODUCT(LEN(A1:A10)-LEN(SUBSTITUTE(A1:A10,B1,"")))/LEN(B1)

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Phrank" wrote in message
...
Hello,

I've got a row of numbers as shown below. I need to count the number
of times a particular number shows up in this column range. But, if I
do the usual COUNTIF, I don't get the proper number. I've tried
=COUNTIF(A1:A10,"147"), but only come up with 2. I need an answer of
6. Any help would be greatly appreciated.

147
148
147
147,150
145,146
147,147
142
143,147
140
136



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 153
Default COUNTIF in a range (and parts of cells)

Works beautifully! Thank you very much.

Frank

On Mon, 9 Oct 2006 18:42:57 -0700, "RagDyer"
wrote:

Use B1 to hold your criteria (147),
Then try this:

=SUMPRODUCT(LEN(A1:A10)-LEN(SUBSTITUTE(A1:A10,B1,"")))/LEN(B1)

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
VLookup Error in Part of a Named Range Dallas64 Excel Worksheet Functions 6 April 18th 06 02:13 PM
Delete range on another sheet when checkbox is unchecked Robb27 Excel Discussion (Misc queries) 14 April 5th 06 12:54 AM
Merging Info in Two Cells [email protected] Excel Discussion (Misc queries) 1 December 28th 05 10:43 PM
Copying functions from one cell to other cells aaronwexler New Users to Excel 4 December 6th 05 04:25 PM
Vlookup of parts of a word in a range of Data Andre Croteau Excel Discussion (Misc queries) 3 December 19th 04 07:26 PM


All times are GMT +1. The time now is 07:31 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"