Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default formula for counting

I need a formula to count if A:A=1 and B:B<20
The value should be 2
A B
1 1 12
2 2 75
3 1 86
4 1 16

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default formula for counting

One way:

=SUMPRODUCT(--(A1:A100=1)*(B1:B100<20))

This requires that you specify a range, not the entire column.

Regards,
Paul

"TMF in MN" wrote in message
...
I need a formula to count if A:A=1 and B:B<20
The value should be 2
A B
1 1 12
2 2 75
3 1 86
4 1 16



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default formula for counting

=SUMPRODUCT(--(A1:A100=1),--(B1:B100<20))

Note that SUMPRODUCT doesn't work with complete columns, you have to specify
a range.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"TMF in MN" wrote in message
...
I need a formula to count if A:A=1 and B:B<20
The value should be 2
A B
1 1 12
2 2 75
3 1 86
4 1 16



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 605
Default formula for counting

I think

=SUMPRODUCT((A1:A100=1)*(B1:B100<20))

is also fine - without coercing.

Epinn

"PCLIVE" wrote in message ...
One way:

=SUMPRODUCT(--(A1:A100=1)*(B1:B100<20))

This requires that you specify a range, not the entire column.

Regards,
Paul

"TMF in MN" wrote in message
...
I need a formula to count if A:A=1 and B:B<20
The value should be 2
A B
1 1 12
2 2 75
3 1 86
4 1 16




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default formula for counting


"Epinn" wrote in message
...

is also fine - without coercing.


What makes you say without coercing?





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 605
Default formula for counting

Wrong term. I should be more specific and used the term "double unary." * (multiplication sign) is also coercing, right? One of these days, I'll get it right.

Epinn

"Bob Phillips" wrote in message ...

"Epinn" wrote in message
...

is also fine - without coercing.


What makes you say without coercing?




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default formula for counting

Coercing is forcing TRUE/FALSE to 1/0. All operators do that.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Epinn" wrote in message
...
Wrong term. I should be more specific and used the term "double unary." *
(multiplication sign) is also coercing, right? One of these days, I'll get
it right.

Epinn

"Bob Phillips" wrote in message
...

"Epinn" wrote in message
...

is also fine - without coercing.


What makes you say without coercing?





  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 605
Default formula for counting

Yes, I know the first part. I have to think about the second. *All* operators, eh? I am only familiar with + - * /

Epinn

"Bob Phillips" wrote in message ...
Coercing is forcing TRUE/FALSE to 1/0. All operators do that.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Epinn" wrote in message
...
Wrong term. I should be more specific and used the term "double unary." *
(multiplication sign) is also coercing, right? One of these days, I'll get
it right.

Epinn

"Bob Phillips" wrote in message
...

"Epinn" wrote in message
...

is also fine - without coercing.


What makes you say without coercing?






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
Reusing formula Tony29 Excel Discussion (Misc queries) 7 September 7th 06 03:34 AM
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 07:48 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM


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