Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Ed Gregory
 
Posts: n/a
Default Count occurances Problem

I have a range a1:a150 that can contain"rx" and could possibly contain
"rx(2)" which means there are 2 "rx" at location. Note: The same field can
have "rx,dx,sx" or "rx(2),dx,sx(4)", etc.

I want to count the occurrences when a1:a150 contains "rx" and add to count
by whatever is included in parentheses.

For example if a1-a5 contains "rx(2),sx" and a6-a10 contains "rx,dx" the
value of formula should return 15 because. I need to allow for multple
values per cell so I can do similar calcs based on different values
separated by commas.

Thanks in advance.


  #2   Report Post  
bj
 
Posts: n/a
Default


=sum(if(iserror(find("rx(",a1:A150)),if(iserror(fi nd("rx",A1:A150)),0,1),value(mid(A1:A150,find("rx( ",A1:A150)+3,1))))

enter as an array function (Control-Shift-Enter)

"Ed Gregory" wrote:

I have a range a1:a150 that can contain"rx" and could possibly contain
"rx(2)" which means there are 2 "rx" at location. Note: The same field can
have "rx,dx,sx" or "rx(2),dx,sx(4)", etc.

I want to count the occurrences when a1:a150 contains "rx" and add to count
by whatever is included in parentheses.

For example if a1-a5 contains "rx(2),sx" and a6-a10 contains "rx,dx" the
value of formula should return 15 because. I need to allow for multple
values per cell so I can do similar calcs based on different values
separated by commas.

Thanks in advance.



  #3   Report Post  
Ed Gregory
 
Posts: n/a
Default

Thank you very much!!!


"bj" wrote in message
...

=sum(if(iserror(find("rx(",a1:A150)),if(iserror(fi nd("rx",A1:A150)),0,1),value(mid(A1:A150,find("rx( ",A1:A150)+3,1))))

enter as an array function (Control-Shift-Enter)

"Ed Gregory" wrote:

I have a range a1:a150 that can contain"rx" and could possibly contain
"rx(2)" which means there are 2 "rx" at location. Note: The same field
can
have "rx,dx,sx" or "rx(2),dx,sx(4)", etc.

I want to count the occurrences when a1:a150 contains "rx" and add to
count
by whatever is included in parentheses.

For example if a1-a5 contains "rx(2),sx" and a6-a10 contains "rx,dx" the
value of formula should return 15 because. I need to allow for multple
values per cell so I can do similar calcs based on different values
separated by commas.

Thanks in advance.





  #4   Report Post  
Domenic
 
Posts: n/a
Default

Can be shortened to...

=SUM(IF(ISNUMBER(SEARCH("rx(",A1:A10)),MID(A1:A10, SEARCH("rx(",A1:A10)+3,
1)+0))

....confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!

In article ,
"bj" wrote:

=sum(if(iserror(find("rx(",a1:A150)),if(iserror(fi nd("rx",A1:A150)),0,1),value
(mid(A1:A150,find("rx(",A1:A150)+3,1))))

enter as an array function (Control-Shift-Enter)

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 With Date Problem rbdude Excel Worksheet Functions 2 June 8th 05 02:47 AM
Excel Display Problem Bill Martin -- (Remove NOSPAM from address) Excel Discussion (Misc queries) 0 April 19th 05 05:25 PM
count a group of numbers but do not count duplicates Lisaml Excel Worksheet Functions 2 January 26th 05 11:19 PM
Count number to reach a cumulative value Bruce Excel Worksheet Functions 5 January 25th 05 05:14 PM
Count data entries and date problem Gef Excel Worksheet Functions 5 November 4th 04 02:30 PM


All times are GMT +1. The time now is 08:12 PM.

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"