Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default how do i count how many times x in column a = 1 or 2 in column b

In column A, I have the numbers 1 - 6 recurring many times. In column B, I
have different prices for 1-6 eg, $5, $6, $7 and there are multiple
occurences where 1 =$5, $6 etc
What function do I type into a cell in column C to count how many times 1 =
$5, 1 = $6, 2 = $5, 2 = $6 etc.

I have tried =countif(a1:a100=1,b1:b100=$5) no good.
=if(and(a1:a100=1,b1:b100=$5) no good either. Seems so simple. Help

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 695
Default how do i count how many times x in column a = 1 or 2 in column b

=SUM((A1:A100=1)*(B1:B100=5)) hit ctrl+shift+enter
=SUM((A1:A100=2)*(B1:B100=5)) hit ctrl+shift+enter



"Tony the Bajan" skrev:

In column A, I have the numbers 1 - 6 recurring many times. In column B, I
have different prices for 1-6 eg, $5, $6, $7 and there are multiple
occurences where 1 =$5, $6 etc
What function do I type into a cell in column C to count how many times 1 =
$5, 1 = $6, 2 = $5, 2 = $6 etc.

I have tried =countif(a1:a100=1,b1:b100=$5) no good.
=if(and(a1:a100=1,b1:b100=$5) no good either. Seems so simple. Help

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default how do i count how many times x in column a = 1 or 2 in column b

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

"Tony the Bajan" wrote:

In column A, I have the numbers 1 - 6 recurring many times. In column B, I
have different prices for 1-6 eg, $5, $6, $7 and there are multiple
occurences where 1 =$5, $6 etc
What function do I type into a cell in column C to count how many times 1 =
$5, 1 = $6, 2 = $5, 2 = $6 etc.

I have tried =countif(a1:a100=1,b1:b100=$5) no good.
=if(and(a1:a100=1,b1:b100=$5) no good either. Seems so simple. Help

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 40
Default how do i count how many times x in column a = 1 or 2 in column b

Try sumproduct.

sumproduct((a1:a100=1)*(b1:b100=$5))


Tony the Bajan wrote:
In column A, I have the numbers 1 - 6 recurring many times. In column B, I
have different prices for 1-6 eg, $5, $6, $7 and there are multiple
occurences where 1 =$5, $6 etc
What function do I type into a cell in column C to count how many times 1 =
$5, 1 = $6, 2 = $5, 2 = $6 etc.

I have tried =countif(a1:a100=1,b1:b100=$5) no good.
=if(and(a1:a100=1,b1:b100=$5) no good either. Seems so simple. Help

Thanks


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default how do i count how many times x in column a = 1 or 2 in column

Hi Excelent,

Thanks for your time and suggestion but neither works. It only counts cell
a1 and b1 and gives the answer 1 even when I change all the cells in col A to
be 1 and all the cells in col B to be 5.

Cheers

"excelent" wrote:

=SUM((A1:A100=1)*(B1:B100=5)) hit ctrl+shift+enter
=SUM((A1:A100=2)*(B1:B100=5)) hit ctrl+shift+enter



"Tony the Bajan" skrev:

In column A, I have the numbers 1 - 6 recurring many times. In column B, I
have different prices for 1-6 eg, $5, $6, $7 and there are multiple
occurences where 1 =$5, $6 etc
What function do I type into a cell in column C to count how many times 1 =
$5, 1 = $6, 2 = $5, 2 = $6 etc.

I have tried =countif(a1:a100=1,b1:b100=$5) no good.
=if(and(a1:a100=1,b1:b100=$5) no good either. Seems so simple. Help

Thanks



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default how do i count how many times x in column a = 1 or 2 in column

Hi Toppers,

This returns a value of 0 even when i change all the cells in col A to 1 and
all of b to 5. Thanks for the suggestion.

Tony

"Toppers" wrote:

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

"Tony the Bajan" wrote:

In column A, I have the numbers 1 - 6 recurring many times. In column B, I
have different prices for 1-6 eg, $5, $6, $7 and there are multiple
occurences where 1 =$5, $6 etc
What function do I type into a cell in column C to count how many times 1 =
$5, 1 = $6, 2 = $5, 2 = $6 etc.

I have tried =countif(a1:a100=1,b1:b100=$5) no good.
=if(and(a1:a100=1,b1:b100=$5) no good either. Seems so simple. Help

Thanks

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default how do i count how many times x in column a = 1 or 2 in column

Thank you very much Willwonka, problem solved.

Have a good day, year and life.

Tony the bajan

"willwonka" wrote:

Try sumproduct.

sumproduct((a1:a100=1)*(b1:b100=$5))


Tony the Bajan wrote:
In column A, I have the numbers 1 - 6 recurring many times. In column B, I
have different prices for 1-6 eg, $5, $6, $7 and there are multiple
occurences where 1 =$5, $6 etc
What function do I type into a cell in column C to count how many times 1 =
$5, 1 = $6, 2 = $5, 2 = $6 etc.

I have tried =countif(a1:a100=1,b1:b100=$5) no good.
=if(and(a1:a100=1,b1:b100=$5) no good either. Seems so simple. Help

Thanks



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default how do i count how many times x in column a = 1 or 2 in column

Sorry ... typo ...

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


"Tony the Bajan" wrote:

Hi Toppers,

This returns a value of 0 even when i change all the cells in col A to 1 and
all of b to 5. Thanks for the suggestion.

Tony

"Toppers" wrote:

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

"Tony the Bajan" wrote:

In column A, I have the numbers 1 - 6 recurring many times. In column B, I
have different prices for 1-6 eg, $5, $6, $7 and there are multiple
occurences where 1 =$5, $6 etc
What function do I type into a cell in column C to count how many times 1 =
$5, 1 = $6, 2 = $5, 2 = $6 etc.

I have tried =countif(a1:a100=1,b1:b100=$5) no good.
=if(and(a1:a100=1,b1:b100=$5) no good either. Seems so simple. Help

Thanks

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 695
Default how do i count how many times x in column a = 1 or 2 in column

well then i think u forgot to hit CTRL+SHIFT+ENTER after pasting the formula

"Tony the Bajan" skrev:

Hi Excelent,

Thanks for your time and suggestion but neither works. It only counts cell
a1 and b1 and gives the answer 1 even when I change all the cells in col A to
be 1 and all the cells in col B to be 5.

Cheers

"excelent" wrote:

=SUM((A1:A100=1)*(B1:B100=5)) hit ctrl+shift+enter
=SUM((A1:A100=2)*(B1:B100=5)) hit ctrl+shift+enter



"Tony the Bajan" skrev:

In column A, I have the numbers 1 - 6 recurring many times. In column B, I
have different prices for 1-6 eg, $5, $6, $7 and there are multiple
occurences where 1 =$5, $6 etc
What function do I type into a cell in column C to count how many times 1 =
$5, 1 = $6, 2 = $5, 2 = $6 etc.

I have tried =countif(a1:a100=1,b1:b100=$5) no good.
=if(and(a1:a100=1,b1:b100=$5) no good either. Seems so simple. Help

Thanks

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
Positioning Numeric Values Resulting from 6 Column Array Formula Sam via OfficeKB.com Excel Worksheet Functions 2 January 5th 06 02:03 AM
how do I count the number of times text in column A matches text i Sheila Excel Worksheet Functions 2 November 16th 05 10:20 PM
How do I count how many times a code appears in a column? Leo Excel Worksheet Functions 3 June 2nd 05 08:50 PM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM
How do I count how many times x appears in a column? Ian Roberts Excel Worksheet Functions 2 November 7th 04 03:13 PM


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