Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 39
Default Need to Count Occurences in Multiple Ranges

I have two non-contiguous ranges that contain individual letters. I need a
formula that will count the number of occurrences of the letters P and L
within those ranges, let's call them B7:Q7 and B18:E18. Can it be done with
one formula or do I have to count the ranges separately and then add them
together?

I'm running Excel 2003. Thanks in advance for any help.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Need to Count Occurences in Multiple Ranges

Try this:

=SUM(COUNTIF(B7:Q7,{"P","L"}),COUNTIF(B18:E18,{"P" ,"L"}))

--
Biff
Microsoft Excel MVP


"Loris" wrote in message
...
I have two non-contiguous ranges that contain individual letters. I need a
formula that will count the number of occurrences of the letters P and L
within those ranges, let's call them B7:Q7 and B18:E18. Can it be done
with
one formula or do I have to count the ranges separately and then add them
together?

I'm running Excel 2003. Thanks in advance for any help.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default Need to Count Occurences in Multiple Ranges

If your cells will not have additional characters in them (meaning, only "P"
or only "L" with no other characters in the cells with them, then see
T.Valko's response.
If the cells have more than just "P" or "L" (example: "Paul" or "Larry" one
count as 1 each), then here's the hard way:


=(LEN(CONCATENATE(B7,C7,D7,E7,F7,G7,H7,I7,J7,K7,L7 ,M7,N7,O7,P7,Q7))-LEN(SUBSTITUTE(CONCATENATE(B7,C7,D7,E7,F7,G7,H7,I7 ,J7,K7,L7,M7,N7,O7,P7,Q7),"L","")))+(LEN(CONCATENA TE(B7,C7,D7,E7,F7,G7,H7,I7,J7,K7,L7,M7,N7,O7,P7,Q7 ))-LEN(SUBSTITUTE(CONCATENATE(B7,C7,D7,E7,F7,G7,H7,I7 ,J7,K7,L7,M7,N7,O7,P7,Q7),"P","")))+(LEN(CONCATENA TE(B18,C18,D18,E18,F18,G18,H18,I18,J18,K18,L18,M18 ,N18,O18,P18,Q18))-LEN(SUBSTITUTE(CONCATENATE(B18,C18,D18,E18,F18,G18 ,H18,I18,J18,K18,L18,M18,N18,O18,P18,Q18),"L","")) )+(LEN(CONCATENATE(B18,C18,D18,E18,F18,G18,H18,I18 ,J18,K18,L18,M18,N18,O18,P18,Q18))-LEN(SUBSTITUTE(CONCATENATE(B18,C18,D18,E18,F18,G18 ,H18,I18,J18,K18,L18,M18,N18,O18,P18,Q18),"P","")) )


"Loris" wrote in message
...
I have two non-contiguous ranges that contain individual letters. I need a
formula that will count the number of occurrences of the letters P and L
within those ranges, let's call them B7:Q7 and B18:E18. Can it be done
with
one formula or do I have to count the ranges separately and then add them
together?

I'm running Excel 2003. Thanks in advance for any help.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj bj is offline
external usenet poster
 
Posts: 1,397
Default Need to Count Occurences in Multiple Ranges

I think you will have to use four functions
=countif(range1,"P")+countif(range1,"L")+countif(r ange 2.....

"Loris" wrote:

I have two non-contiguous ranges that contain individual letters. I need a
formula that will count the number of occurrences of the letters P and L
within those ranges, let's call them B7:Q7 and B18:E18. Can it be done with
one formula or do I have to count the ranges separately and then add them
together?

I'm running Excel 2003. Thanks in advance for any help.

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
Count Occurences Lmurraz Excel Discussion (Misc queries) 3 July 11th 07 02:46 PM
Count # of Occurences Sweepea Excel Discussion (Misc queries) 6 December 14th 06 02:27 AM
Count Occurences problem anandmr65 Excel Discussion (Misc queries) 4 April 19th 06 05:42 AM
Evaluating multiple ranges for a count function JustMe602 Excel Worksheet Functions 4 October 7th 05 02:37 AM
Count occurences between dates DJ Dusty Excel Worksheet Functions 3 November 11th 04 12:25 AM


All times are GMT +1. The time now is 05:24 AM.

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

About Us

"It's about Microsoft Excel"