Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 40
Default count based on single number

The column has data like this A1, 7*9; A2, 1*4; A3, 10*10. The numbers vary.
I need to count the number of cells that have a number less than five to the
left of the asterink. The asterink has nothing to do with multiplication. I
have created a formula using the countif function,
=countif(A1:A200,1&"*")+countif(A1:A200,2&"*") etc for 3 and 4. It works well
except when the number to the left of the asterink is 10, which results in
that cell being counted because of the wildcard to the right. How can the
formula be modified to just count based on the number 1 and not the 10 as the
characters to the right of the first number, 1, vary?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default count based on single number

Hi,

Try this array formula

=COUNT(IF((LEFT(A1:A20,FIND("*",A1:A20)-1)+0)<5,1))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

Mike

"Basenji" wrote:

The column has data like this A1, 7*9; A2, 1*4; A3, 10*10. The numbers vary.
I need to count the number of cells that have a number less than five to the
left of the asterink. The asterink has nothing to do with multiplication. I
have created a formula using the countif function,
=countif(A1:A200,1&"*")+countif(A1:A200,2&"*") etc for 3 and 4. It works well
except when the number to the left of the asterink is 10, which results in
that cell being counted because of the wildcard to the right. How can the
formula be modified to just count based on the number 1 and not the 10 as the
characters to the right of the first number, 1, vary?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 40
Default count based on single number

Mike: the formula works but is returning one additional cell because I was
not clear in my original message. I need to count the cells where the first
number is greater than zero and less than five. How does this nested formula
need to be modified. Thank you.

"Mike H" wrote:

Hi,

Try this array formula

=COUNT(IF((LEFT(A1:A20,FIND("*",A1:A20)-1)+0)<5,1))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

Mike

"Basenji" wrote:

The column has data like this A1, 7*9; A2, 1*4; A3, 10*10. The numbers vary.
I need to count the number of cells that have a number less than five to the
left of the asterink. The asterink has nothing to do with multiplication. I
have created a formula using the countif function,
=countif(A1:A200,1&"*")+countif(A1:A200,2&"*") etc for 3 and 4. It works well
except when the number to the left of the asterink is 10, which results in
that cell being counted because of the wildcard to the right. How can the
formula be modified to just count based on the number 1 and not the 10 as the
characters to the right of the first number, 1, vary?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default count based on single number

=COUNT(IF(((LEFT(A1:A20,FIND("*",A1:A20)-1)+0)0)*((LEFT(A1:A20,FIND("*",A1:A20)-1)+0)<5),1))

ctrl+shift+enter, not just enter


"Basenji" wrote:

Mike: the formula works but is returning one additional cell because I was
not clear in my original message. I need to count the cells where the first
number is greater than zero and less than five. How does this nested formula
need to be modified. Thank you.

"Mike H" wrote:

Hi,

Try this array formula

=COUNT(IF((LEFT(A1:A20,FIND("*",A1:A20)-1)+0)<5,1))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

Mike

"Basenji" wrote:

The column has data like this A1, 7*9; A2, 1*4; A3, 10*10. The numbers vary.
I need to count the number of cells that have a number less than five to the
left of the asterink. The asterink has nothing to do with multiplication. I
have created a formula using the countif function,
=countif(A1:A200,1&"*")+countif(A1:A200,2&"*") etc for 3 and 4. It works well
except when the number to the left of the asterink is 10, which results in
that cell being counted because of the wildcard to the right. How can the
formula be modified to just count based on the number 1 and not the 10 as the
characters to the right of the first number, 1, vary?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default count based on single number

Hi,

Not and improvement on TM's formula, just different

=COUNT(IF((LEFT(A1:A20,FIND("*",A1:A20)-1)+0)0,IF((LEFT(A1:A20,FIND("*",A1:A20)-1)+0)<5,1)))

Ctrl+Shift+Enter

Mike

"Basenji" wrote:

Mike: the formula works but is returning one additional cell because I was
not clear in my original message. I need to count the cells where the first
number is greater than zero and less than five. How does this nested formula
need to be modified. Thank you.

"Mike H" wrote:

Hi,

Try this array formula

=COUNT(IF((LEFT(A1:A20,FIND("*",A1:A20)-1)+0)<5,1))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

Mike

"Basenji" wrote:

The column has data like this A1, 7*9; A2, 1*4; A3, 10*10. The numbers vary.
I need to count the number of cells that have a number less than five to the
left of the asterink. The asterink has nothing to do with multiplication. I
have created a formula using the countif function,
=countif(A1:A200,1&"*")+countif(A1:A200,2&"*") etc for 3 and 4. It works well
except when the number to the left of the asterink is 10, which results in
that cell being counted because of the wildcard to the right. How can the
formula be modified to just count based on the number 1 and not the 10 as the
characters to the right of the first number, 1, vary?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 40
Default count based on single number

Now I need a variation of this formula. The cell content is the same, 5*4,
etc. This time I need to count the the number of cells in which the second
number of this string, ie 4, is less than 6. I have tried to adapt the
original formula but have been unsuccessful. Thank you for your assistance.

"Mike H" wrote:

Hi,

Not and improvement on TM's formula, just different

=COUNT(IF((LEFT(A1:A20,FIND("*",A1:A20)-1)+0)0,IF((LEFT(A1:A20,FIND("*",A1:A20)-1)+0)<5,1)))

Ctrl+Shift+Enter

Mike

"Basenji" wrote:

Mike: the formula works but is returning one additional cell because I was
not clear in my original message. I need to count the cells where the first
number is greater than zero and less than five. How does this nested formula
need to be modified. Thank you.

"Mike H" wrote:

Hi,

Try this array formula

=COUNT(IF((LEFT(A1:A20,FIND("*",A1:A20)-1)+0)<5,1))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

Mike

"Basenji" wrote:

The column has data like this A1, 7*9; A2, 1*4; A3, 10*10. The numbers vary.
I need to count the number of cells that have a number less than five to the
left of the asterink. The asterink has nothing to do with multiplication. I
have created a formula using the countif function,
=countif(A1:A200,1&"*")+countif(A1:A200,2&"*") etc for 3 and 4. It works well
except when the number to the left of the asterink is 10, which results in
that cell being counted because of the wildcard to the right. How can the
formula be modified to just count based on the number 1 and not the 10 as the
characters to the right of the first number, 1, vary?

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default count based on single number

I need to count the cells where the first
number is greater than zero and less than five.


Does that mean some of the first numbers might be negative:

-5*10
0*00
-2*100
17*55

Are the numbers *always* whole numbers?

1.5*8
-0.2*77
5.7*7

--
Biff
Microsoft Excel MVP


"Basenji" wrote in message
...
Mike: the formula works but is returning one additional cell because I
was
not clear in my original message. I need to count the cells where the
first
number is greater than zero and less than five. How does this nested
formula
need to be modified. Thank you.

"Mike H" wrote:

Hi,

Try this array formula

=COUNT(IF((LEFT(A1:A20,FIND("*",A1:A20)-1)+0)<5,1))

This is an array formula which must be entered by pressing
CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly
brackets
'around the formula {}. You can't type these yourself. If you edit the
formula
'you must enter it again with CTRL+Shift+Enter.

Mike

"Basenji" wrote:

The column has data like this A1, 7*9; A2, 1*4; A3, 10*10. The numbers
vary.
I need to count the number of cells that have a number less than five
to the
left of the asterink. The asterink has nothing to do with
multiplication. I
have created a formula using the countif function,
=countif(A1:A200,1&"*")+countif(A1:A200,2&"*") etc for 3 and 4. It
works well
except when the number to the left of the asterink is 10, which results
in
that cell being counted because of the wildcard to the right. How can
the
formula be modified to just count based on the number 1 and not the 10
as the
characters to the right of the first number, 1, vary?



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 40
Default count based on single number

The numbers are always positivie and whole numbers.

"T. Valko" wrote:

I need to count the cells where the first
number is greater than zero and less than five.


Does that mean some of the first numbers might be negative:

-5*10
0*00
-2*100
17*55

Are the numbers *always* whole numbers?

1.5*8
-0.2*77
5.7*7

--
Biff
Microsoft Excel MVP


"Basenji" wrote in message
...
Mike: the formula works but is returning one additional cell because I
was
not clear in my original message. I need to count the cells where the
first
number is greater than zero and less than five. How does this nested
formula
need to be modified. Thank you.

"Mike H" wrote:

Hi,

Try this array formula

=COUNT(IF((LEFT(A1:A20,FIND("*",A1:A20)-1)+0)<5,1))

This is an array formula which must be entered by pressing
CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly
brackets
'around the formula {}. You can't type these yourself. If you edit the
formula
'you must enter it again with CTRL+Shift+Enter.

Mike

"Basenji" wrote:

The column has data like this A1, 7*9; A2, 1*4; A3, 10*10. The numbers
vary.
I need to count the number of cells that have a number less than five
to the
left of the asterink. The asterink has nothing to do with
multiplication. I
have created a formula using the countif function,
=countif(A1:A200,1&"*")+countif(A1:A200,2&"*") etc for 3 and 4. It
works well
except when the number to the left of the asterink is 10, which results
in
that cell being counted because of the wildcard to the right. How can
the
formula be modified to just count based on the number 1 and not the 10
as the
characters to the right of the first number, 1, vary?




  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default count based on single number

This works based on the following limitations:

No empty cells within the range
Every cell has a maximum of 2 numbers separated by an asterisk.

=SUMPRODUCT(--(INT(--SUBSTITUTE(A1:A6,"*","."))0),--(INT(--SUBSTITUTE(A1:A6,"*","."))<5))

--
Biff
Microsoft Excel MVP


"Basenji" wrote in message
...
The numbers are always positivie and whole numbers.

"T. Valko" wrote:

I need to count the cells where the first
number is greater than zero and less than five.


Does that mean some of the first numbers might be negative:

-5*10
0*00
-2*100
17*55

Are the numbers *always* whole numbers?

1.5*8
-0.2*77
5.7*7

--
Biff
Microsoft Excel MVP


"Basenji" wrote in message
...
Mike: the formula works but is returning one additional cell because I
was
not clear in my original message. I need to count the cells where the
first
number is greater than zero and less than five. How does this nested
formula
need to be modified. Thank you.

"Mike H" wrote:

Hi,

Try this array formula

=COUNT(IF((LEFT(A1:A20,FIND("*",A1:A20)-1)+0)<5,1))

This is an array formula which must be entered by pressing
CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly
brackets
'around the formula {}. You can't type these yourself. If you edit the
formula
'you must enter it again with CTRL+Shift+Enter.

Mike

"Basenji" wrote:

The column has data like this A1, 7*9; A2, 1*4; A3, 10*10. The
numbers
vary.
I need to count the number of cells that have a number less than
five
to the
left of the asterink. The asterink has nothing to do with
multiplication. I
have created a formula using the countif function,
=countif(A1:A200,1&"*")+countif(A1:A200,2&"*") etc for 3 and 4. It
works well
except when the number to the left of the asterink is 10, which
results
in
that cell being counted because of the wildcard to the right. How
can
the
formula be modified to just count based on the number 1 and not the
10
as the
characters to the right of the first number, 1, vary?






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 occurance of largest duplicate number in a single column ran catpro New Users to Excel 5 January 21st 07 05:10 PM
can you count the number of letters (inc spaces) in a single sell greenstone New Users to Excel 2 August 3rd 05 11:06 AM
How do you count number of characters in a single cell Joe Excel Worksheet Functions 1 February 18th 05 09:08 PM
How do you count number of characters in a single cell Joe Excel Worksheet Functions 1 February 18th 05 08:33 PM
How do you count number of characthers in a single cell? Joe Excel Worksheet Functions 2 February 18th 05 08:06 PM


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

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"