Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Marc Fleury
 
Posts: n/a
Default Array functions ARGHH!

I'm pretty sure I need an array function for this, but nothing I do
works.

My data is basically two colums:

A B
0 0
0 2
1 0
1 0
1 4
2 1
3 3
3 3
4 0

etc

Now, I need to create a table that counts how many instance of each pair
there are. Like so:

0 1 2 3 4
___________
0 |1 0 1 0 0
1 |2 0 0 0 1
2 |0 1 0 0 0
3 |0 0 0 2 0
4 |1 0 0 0 0


So the upper left cell counts how many times there is a 0 in column A
AND a 0 in colum B (once). The next cell to the right counts how many
times there is a 0 in column A and a 1 in colum B (zero times). Etc.

The closest that I have come is

{=SUM(IF(($A$1:$A$10=0)+($B$1:$B$10=0),1,0))}

I actually have reference cells for the "0" that's being compared to, so
that I can use the same formula for every cell in the table, but I know
how to do that part.

The problem with this formula is that it counts how many times there is
a zero in column A OR a zero in column B.

HELP!

--
Marc.
  #2   Report Post  
JulieD
 
Posts: n/a
Default

Hi Marc

no array formula needed
with you list in A1:B20
and your result table in D1:I6

=SUMPRODUCT(--($A$1:$A$20=$D2),--($B$1:$B$20=E$1))
fill down and across

Cheers
JulieD

"Marc Fleury" wrote in message
77.134...
I'm pretty sure I need an array function for this, but nothing I do
works.

My data is basically two colums:

A B
0 0
0 2
1 0
1 0
1 4
2 1
3 3
3 3
4 0

etc

Now, I need to create a table that counts how many instance of each pair
there are. Like so:

0 1 2 3 4
___________
0 |1 0 1 0 0
1 |2 0 0 0 1
2 |0 1 0 0 0
3 |0 0 0 2 0
4 |1 0 0 0 0


So the upper left cell counts how many times there is a 0 in column A
AND a 0 in colum B (once). The next cell to the right counts how many
times there is a 0 in column A and a 1 in colum B (zero times). Etc.

The closest that I have come is

{=SUM(IF(($A$1:$A$10=0)+($B$1:$B$10=0),1,0))}

I actually have reference cells for the "0" that's being compared to, so
that I can use the same formula for every cell in the table, but I know
how to do that part.

The problem with this formula is that it counts how many times there is
a zero in column A OR a zero in column B.

HELP!

--
Marc.



  #3   Report Post  
Marc Fleury
 
Posts: n/a
Default

You folks rock.

I did eventually figure out that I could use * instead of + to do what I
needed with the array function (which another poster also pointed out).
But I'll also try out everyone else's suggestion to see which one feels
most intuitive.


--
Marc.


"JulieD" wrote in news:eAVltJkKFHA.568
@TK2MSFTNGP09.phx.gbl:

Hi Marc

no array formula needed
with you list in A1:B20
and your result table in D1:I6

=SUMPRODUCT(--($A$1:$A$20=$D2),--($B$1:$B$20=E$1))
fill down and across

Cheers
JulieD

"Marc Fleury" wrote in message
77.134...
I'm pretty sure I need an array function for this, but nothing I do
works.

My data is basically two colums:

A B
0 0
0 2
1 0
1 0
1 4
2 1
3 3
3 3
4 0

etc

Now, I need to create a table that counts how many instance of each

pair
there are. Like so:

0 1 2 3 4
___________
0 |1 0 1 0 0
1 |2 0 0 0 1
2 |0 1 0 0 0
3 |0 0 0 2 0
4 |1 0 0 0 0


So the upper left cell counts how many times there is a 0 in column A
AND a 0 in colum B (once). The next cell to the right counts how many
times there is a 0 in column A and a 1 in colum B (zero times). Etc.

The closest that I have come is

{=SUM(IF(($A$1:$A$10=0)+($B$1:$B$10=0),1,0))}

I actually have reference cells for the "0" that's being compared to,

so
that I can use the same formula for every cell in the table, but I

know
how to do that part.

The problem with this formula is that it counts how many times there

is
a zero in column A OR a zero in column B.

HELP!

--
Marc.




  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

Assuming the results are in H1:M10 or so, then in I2 enter

=SUMPRODUCT(--($A$1:$A$10<""),--($A$1:$A$10=$H2),--($B$1:$B$10<""),--($B$1
:$B$10=I$1))

and copy down and across

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Marc Fleury" wrote in message
77.134...
I'm pretty sure I need an array function for this, but nothing I do
works.

My data is basically two colums:

A B
0 0
0 2
1 0
1 0
1 4
2 1
3 3
3 3
4 0

etc

Now, I need to create a table that counts how many instance of each pair
there are. Like so:

0 1 2 3 4
___________
0 |1 0 1 0 0
1 |2 0 0 0 1
2 |0 1 0 0 0
3 |0 0 0 2 0
4 |1 0 0 0 0


So the upper left cell counts how many times there is a 0 in column A
AND a 0 in colum B (once). The next cell to the right counts how many
times there is a 0 in column A and a 1 in colum B (zero times). Etc.

The closest that I have come is

{=SUM(IF(($A$1:$A$10=0)+($B$1:$B$10=0),1,0))}

I actually have reference cells for the "0" that's being compared to, so
that I can use the same formula for every cell in the table, but I know
how to do that part.

The problem with this formula is that it counts how many times there is
a zero in column A OR a zero in column B.

HELP!

--
Marc.



  #5   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Marc,

Oh, you were close: chnge the + to a *, and use the cell references in mixed
mode, like so

=SUM(IF(($A$1:$A$10=$D2)*($B$1:$B$10=E$1),1,0))

HTH,
Bernie
MS Excel MVP

"Marc Fleury" wrote in message
77.134...
I'm pretty sure I need an array function for this, but nothing I do
works.

My data is basically two colums:

A B
0 0
0 2
1 0
1 0
1 4
2 1
3 3
3 3
4 0

etc

Now, I need to create a table that counts how many instance of each pair
there are. Like so:

0 1 2 3 4
___________
0 |1 0 1 0 0
1 |2 0 0 0 1
2 |0 1 0 0 0
3 |0 0 0 2 0
4 |1 0 0 0 0


So the upper left cell counts how many times there is a 0 in column A
AND a 0 in colum B (once). The next cell to the right counts how many
times there is a 0 in column A and a 1 in colum B (zero times). Etc.

The closest that I have come is

{=SUM(IF(($A$1:$A$10=0)+($B$1:$B$10=0),1,0))}

I actually have reference cells for the "0" that's being compared to, so
that I can use the same formula for every cell in the table, but I know
how to do that part.

The problem with this formula is that it counts how many times there is
a zero in column A OR a zero in column B.

HELP!

--
Marc.





  #6   Report Post  
Bob Umlas
 
Posts: n/a
Default

No array-formula necessary.

in D1:H1: 0 1 2 3 4
in C2:C6: 0;1;2;3;4
in D2:
=SUMPRODUCT(($A$1:$A$10=D$1)*($B$1:$B$10=$C1))
Fill this from D2:H6.
Bob Umlas, MVP


"Marc Fleury" wrote in message
77.134...
I'm pretty sure I need an array function for this, but nothing I do
works.

My data is basically two colums:

A B
0 0
0 2
1 0
1 0
1 4
2 1
3 3
3 3
4 0

etc

Now, I need to create a table that counts how many instance of each pair
there are. Like so:

0 1 2 3 4
___________
0 |1 0 1 0 0
1 |2 0 0 0 1
2 |0 1 0 0 0
3 |0 0 0 2 0
4 |1 0 0 0 0


So the upper left cell counts how many times there is a 0 in column A
AND a 0 in colum B (once). The next cell to the right counts how many
times there is a 0 in column A and a 1 in colum B (zero times). Etc.

The closest that I have come is

{=SUM(IF(($A$1:$A$10=0)+($B$1:$B$10=0),1,0))}

I actually have reference cells for the "0" that's being compared to, so
that I can use the same formula for every cell in the table, but I know
how to do that part.

The problem with this formula is that it counts how many times there is
a zero in column A OR a zero in column B.

HELP!

--
Marc.



  #7   Report Post  
Dave Peterson
 
Posts: n/a
Default

I think if you added headers, a pivottable would be perfect.

Select your range
Data|Pivottable...
follow the wizard until you get to a step that has a "Layout" button on it.
Hit that Layout button.

Drag the header for column A to the Row field
drag the header for column B to the column field
drag the header for column B to the Data field
But double click on that one and make sure it says "Count of"

Finish up the wizard.

Now rightclick on the pivottable and choose Table Options.
For empty cells, show: 0 <-- type that 0.

If you want to read more about the pivottable stuff, you may want to look at
some links:

Debra Dalgleish's pictures at Jon Peltier's site:
http://peltiertech.com/Excel/Pivots/pivottables.htm
And Debra's own site:
http://www.contextures.com/xlPivot01.html

John Walkenbach also has some at:
http://j-walk.com/ss/excel/files/general.htm
(look for Tony Gwynn's Hit Database)

Chip Pearson keeps Harald Staff's notes at:
http://www.cpearson.com/excel/pivots.htm

MS has some at (xl2000 and xl2002):
http://office.microsoft.com/downloads/2000/XCrtPiv.aspx
http://office.microsoft.com/assistan...lconPT101.aspx

Marc Fleury wrote:

I'm pretty sure I need an array function for this, but nothing I do
works.

My data is basically two colums:

A B
0 0
0 2
1 0
1 0
1 4
2 1
3 3
3 3
4 0

etc

Now, I need to create a table that counts how many instance of each pair
there are. Like so:

0 1 2 3 4
___________
0 |1 0 1 0 0
1 |2 0 0 0 1
2 |0 1 0 0 0
3 |0 0 0 2 0
4 |1 0 0 0 0

So the upper left cell counts how many times there is a 0 in column A
AND a 0 in colum B (once). The next cell to the right counts how many
times there is a 0 in column A and a 1 in colum B (zero times). Etc.

The closest that I have come is

{=SUM(IF(($A$1:$A$10=0)+($B$1:$B$10=0),1,0))}

I actually have reference cells for the "0" that's being compared to, so
that I can use the same formula for every cell in the table, but I know
how to do that part.

The problem with this formula is that it counts how many times there is
a zero in column A OR a zero in column B.

HELP!

--
Marc.


--

Dave Peterson
  #8   Report Post  
Wazooli
 
Posts: n/a
Default

Maybe I'm missing something, but I can't get any of these solutions to work.
I use the ranges recommended, and short of trying the pivot table, my table
gets filled with zeroes. I like to try these problems to hone my skills with
other problems, but this one is a doozy.

wazooli


"Marc Fleury" wrote:

I'm pretty sure I need an array function for this, but nothing I do
works.

My data is basically two colums:

A B
0 0
0 2
1 0
1 0
1 4
2 1
3 3
3 3
4 0

etc

Now, I need to create a table that counts how many instance of each pair
there are. Like so:

0 1 2 3 4
___________
0 |1 0 1 0 0
1 |2 0 0 0 1
2 |0 1 0 0 0
3 |0 0 0 2 0
4 |1 0 0 0 0


So the upper left cell counts how many times there is a 0 in column A
AND a 0 in colum B (once). The next cell to the right counts how many
times there is a 0 in column A and a 1 in colum B (zero times). Etc.

The closest that I have come is

{=SUM(IF(($A$1:$A$10=0)+($B$1:$B$10=0),1,0))}

I actually have reference cells for the "0" that's being compared to, so
that I can use the same formula for every cell in the table, but I know
how to do that part.

The problem with this formula is that it counts how many times there is
a zero in column A OR a zero in column B.

HELP!

--
Marc.

  #9   Report Post  
Domenic
 
Posts: n/a
Default

Assumptions:

1) Sheet1 contains your source table

2) the first row in Sheet2 contains your numbers (0 through 4) starting
at B1

3) the first column in Sheet2 contains your other set of numbers (0
through 4) starting at A2

Formula:

Sheet2!B2, copied across and down:

=SUMPRODUCT(--(Sheet1!$A$1:$A$9=$A2),--(Sheet1!$B$1:$B$9=B$1))

Hope this helps!

In article 34,
Marc Fleury wrote:

I'm pretty sure I need an array function for this, but nothing I do
works.

My data is basically two colums:

A B
0 0
0 2
1 0
1 0
1 4
2 1
3 3
3 3
4 0

etc

Now, I need to create a table that counts how many instance of each pair
there are. Like so:

0 1 2 3 4
___________
0 |1 0 1 0 0
1 |2 0 0 0 1
2 |0 1 0 0 0
3 |0 0 0 2 0
4 |1 0 0 0 0


So the upper left cell counts how many times there is a 0 in column A
AND a 0 in colum B (once). The next cell to the right counts how many
times there is a 0 in column A and a 1 in colum B (zero times). Etc.

The closest that I have come is

{=SUM(IF(($A$1:$A$10=0)+($B$1:$B$10=0),1,0))}

I actually have reference cells for the "0" that's being compared to, so
that I can use the same formula for every cell in the table, but I know
how to do that part.

The problem with this formula is that it counts how many times there is
a zero in column A OR a zero in column B.

HELP!

--
Marc.

  #10   Report Post  
Wazooli
 
Posts: n/a
Default

Doesn't. When I look at how Excel evaluates the formula, it seems to have a
problem with $A$20 representing the first range. The sumproduct function
gives all zeroes. The range $B$20, on the other hand, presents no problem.

wazooli


"Domenic" wrote:

Assumptions:

1) Sheet1 contains your source table

2) the first row in Sheet2 contains your numbers (0 through 4) starting
at B1

3) the first column in Sheet2 contains your other set of numbers (0
through 4) starting at A2

Formula:

Sheet2!B2, copied across and down:

=SUMPRODUCT(--(Sheet1!$A$1:$A$9=$A2),--(Sheet1!$B$1:$B$9=B$1))

Hope this helps!

In article 34,
Marc Fleury wrote:

I'm pretty sure I need an array function for this, but nothing I do
works.

My data is basically two colums:

A B
0 0
0 2
1 0
1 0
1 4
2 1
3 3
3 3
4 0

etc

Now, I need to create a table that counts how many instance of each pair
there are. Like so:

0 1 2 3 4
___________
0 |1 0 1 0 0
1 |2 0 0 0 1
2 |0 1 0 0 0
3 |0 0 0 2 0
4 |1 0 0 0 0


So the upper left cell counts how many times there is a 0 in column A
AND a 0 in colum B (once). The next cell to the right counts how many
times there is a 0 in column A and a 1 in colum B (zero times). Etc.

The closest that I have come is

{=SUM(IF(($A$1:$A$10=0)+($B$1:$B$10=0),1,0))}

I actually have reference cells for the "0" that's being compared to, so
that I can use the same formula for every cell in the table, but I know
how to do that part.

The problem with this formula is that it counts how many times there is
a zero in column A OR a zero in column B.

HELP!

--
Marc.




  #11   Report Post  
Bob Phillips
 
Posts: n/a
Default

It does!

I just followed Domenic's instructions and it worked perfectly for me.

Where does A20 and B20 com e into it in your reply?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Wazooli" wrote in message
...
Doesn't. When I look at how Excel evaluates the formula, it seems to have

a
problem with $A$20 representing the first range. The sumproduct function
gives all zeroes. The range $B$20, on the other hand, presents no

problem.

wazooli


"Domenic" wrote:

Assumptions:

1) Sheet1 contains your source table

2) the first row in Sheet2 contains your numbers (0 through 4) starting
at B1

3) the first column in Sheet2 contains your other set of numbers (0
through 4) starting at A2

Formula:

Sheet2!B2, copied across and down:

=SUMPRODUCT(--(Sheet1!$A$1:$A$9=$A2),--(Sheet1!$B$1:$B$9=B$1))

Hope this helps!

In article 34,
Marc Fleury wrote:

I'm pretty sure I need an array function for this, but nothing I do
works.

My data is basically two colums:

A B
0 0
0 2
1 0
1 0
1 4
2 1
3 3
3 3
4 0

etc

Now, I need to create a table that counts how many instance of each

pair
there are. Like so:

0 1 2 3 4
___________
0 |1 0 1 0 0
1 |2 0 0 0 1
2 |0 1 0 0 0
3 |0 0 0 2 0
4 |1 0 0 0 0


So the upper left cell counts how many times there is a 0 in column A
AND a 0 in colum B (once). The next cell to the right counts how many
times there is a 0 in column A and a 1 in colum B (zero times). Etc.

The closest that I have come is

{=SUM(IF(($A$1:$A$10=0)+($B$1:$B$10=0),1,0))}

I actually have reference cells for the "0" that's being compared to,

so
that I can use the same formula for every cell in the table, but I

know
how to do that part.

The problem with this formula is that it counts how many times there

is
a zero in column A OR a zero in column B.

HELP!

--
Marc.




  #12   Report Post  
Wazooli
 
Posts: n/a
Default

I used A1:B20 because JulieD suggested those. I merely filled in to complete
the ranges. If my table is D1:I6, with cell D1 being empty (the numbering
starts beneath and to the right), and I enter
=SUMPRODUCT(--($A$1:$A$20=$D2),--($B$1:$B$20=E$1), filldown and then to the
right, I get all zeroes. When I look at how Excel evaluates the formula, I
can verify that the '--' is working, but the values for the first part of the
expression resolve to '0;0;0;0;...' The second part is correct.



"Bob Phillips" wrote:

It does!

I just followed Domenic's instructions and it worked perfectly for me.

Where does A20 and B20 com e into it in your reply?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Wazooli" wrote in message
...
Doesn't. When I look at how Excel evaluates the formula, it seems to have

a
problem with $A$20 representing the first range. The sumproduct function
gives all zeroes. The range $B$20, on the other hand, presents no

problem.

wazooli


"Domenic" wrote:

Assumptions:

1) Sheet1 contains your source table

2) the first row in Sheet2 contains your numbers (0 through 4) starting
at B1

3) the first column in Sheet2 contains your other set of numbers (0
through 4) starting at A2

Formula:

Sheet2!B2, copied across and down:

=SUMPRODUCT(--(Sheet1!$A$1:$A$9=$A2),--(Sheet1!$B$1:$B$9=B$1))

Hope this helps!

In article 34,
Marc Fleury wrote:

I'm pretty sure I need an array function for this, but nothing I do
works.

My data is basically two colums:

A B
0 0
0 2
1 0
1 0
1 4
2 1
3 3
3 3
4 0

etc

Now, I need to create a table that counts how many instance of each

pair
there are. Like so:

0 1 2 3 4
___________
0 |1 0 1 0 0
1 |2 0 0 0 1
2 |0 1 0 0 0
3 |0 0 0 2 0
4 |1 0 0 0 0


So the upper left cell counts how many times there is a 0 in column A
AND a 0 in colum B (once). The next cell to the right counts how many
times there is a 0 in column A and a 1 in colum B (zero times). Etc.

The closest that I have come is

{=SUM(IF(($A$1:$A$10=0)+($B$1:$B$10=0),1,0))}

I actually have reference cells for the "0" that's being compared to,

so
that I can use the same formula for every cell in the table, but I

know
how to do that part.

The problem with this formula is that it counts how many times there

is
a zero in column A OR a zero in column B.

HELP!

--
Marc.




  #13   Report Post  
Bob Phillips
 
Posts: n/a
Default

Waz,

I have replicated what you did and it still works for me. I get lots of 0 0
entries, because A10-A20 all resolve to 0 0 (that is why my formula tested
for them), but it works.

The B part resolves to
{TRUE;FALSE;TRUE;TRUE;FALSE;FALSE;FALSE;FALSE;TRUE ;TRUE;TRUE;TRUE;TRUE;TRUE;
TRUE;TRUE;TRUE;TRUE;TRUE;TRUE}
for me, or
{1;0;1;1;0;0;0;0;1;1;1;1;1;1;1;1;1;1;1;1}
if I use the double unary. Thnis is in cell E2.
--

HTH

RP
(remove nothere from the email address if mailing direct)


"Wazooli" wrote in message
...
I used A1:B20 because JulieD suggested those. I merely filled in to

complete
the ranges. If my table is D1:I6, with cell D1 being empty (the numbering
starts beneath and to the right), and I enter
=SUMPRODUCT(--($A$1:$A$20=$D2),--($B$1:$B$20=E$1), filldown and then to

the
right, I get all zeroes. When I look at how Excel evaluates the formula,

I
can verify that the '--' is working, but the values for the first part of

the
expression resolve to '0;0;0;0;...' The second part is correct.



"Bob Phillips" wrote:

It does!

I just followed Domenic's instructions and it worked perfectly for me.

Where does A20 and B20 com e into it in your reply?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Wazooli" wrote in message
...
Doesn't. When I look at how Excel evaluates the formula, it seems to

have
a
problem with $A$20 representing the first range. The sumproduct

function
gives all zeroes. The range $B$20, on the other hand, presents no

problem.

wazooli


"Domenic" wrote:

Assumptions:

1) Sheet1 contains your source table

2) the first row in Sheet2 contains your numbers (0 through 4)

starting
at B1

3) the first column in Sheet2 contains your other set of numbers (0
through 4) starting at A2

Formula:

Sheet2!B2, copied across and down:

=SUMPRODUCT(--(Sheet1!$A$1:$A$9=$A2),--(Sheet1!$B$1:$B$9=B$1))

Hope this helps!

In article 34,
Marc Fleury wrote:

I'm pretty sure I need an array function for this, but nothing I

do
works.

My data is basically two colums:

A B
0 0
0 2
1 0
1 0
1 4
2 1
3 3
3 3
4 0

etc

Now, I need to create a table that counts how many instance of

each
pair
there are. Like so:

0 1 2 3 4
___________
0 |1 0 1 0 0
1 |2 0 0 0 1
2 |0 1 0 0 0
3 |0 0 0 2 0
4 |1 0 0 0 0


So the upper left cell counts how many times there is a 0 in

column A
AND a 0 in colum B (once). The next cell to the right counts how

many
times there is a 0 in column A and a 1 in colum B (zero times).

Etc.

The closest that I have come is

{=SUM(IF(($A$1:$A$10=0)+($B$1:$B$10=0),1,0))}

I actually have reference cells for the "0" that's being compared

to,
so
that I can use the same formula for every cell in the table, but I

know
how to do that part.

The problem with this formula is that it counts how many times

there
is
a zero in column A OR a zero in column B.

HELP!

--
Marc.






  #14   Report Post  
Dave O
 
Posts: n/a
Default

My solution has data in these locations:
~ Columnar data in A1:A10 and B1:B10
~ 0,1,2,3,4 in B13:B17
~ 0,1,2,3,4 in C12:G12

I entered this array formula in C13:
=SUM(IF($B13=$A$1:$A$9,IF(C$12=$B$1:$B$9,1,0)))

Copy that over and down thru G17, and you should be good to go.

  #15   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Wed, 16 Mar 2005 15:45:12 GMT, Marc Fleury wrote:

I'm pretty sure I need an array function for this, but nothing I do
works.

My data is basically two colums:

A B
0 0
0 2
1 0
1 0
1 4
2 1
3 3
3 3
4 0

etc

Now, I need to create a table that counts how many instance of each pair
there are. Like so:

0 1 2 3 4
___________
0 |1 0 1 0 0
1 |2 0 0 0 1
2 |0 1 0 0 0
3 |0 0 0 2 0
4 |1 0 0 0 0


So the upper left cell counts how many times there is a 0 in column A
AND a 0 in colum B (once). The next cell to the right counts how many
times there is a 0 in column A and a 1 in colum B (zero times). Etc.

The closest that I have come is

{=SUM(IF(($A$1:$A$10=0)+($B$1:$B$10=0),1,0))}

I actually have reference cells for the "0" that's being compared to, so
that I can use the same formula for every cell in the table, but I know
how to do that part.

The problem with this formula is that it counts how many times there is
a zero in column A OR a zero in column B.

HELP!


I used a Pivot Table from your Data to generate the following report:




Count of A B
0 1 2 3 4
A

0 1 0 1 0 0
1 2 0 0 0 1
2 0 1 0 0 0
3 0 0 0 2 0
4 1 0 0 0 0


The formatting doesn't show well, but the table results are identical to what
you have above.

I used the Pivot Table Wizard after selecting the input table data (including
the A and B headers).

I then dragged "A" to the row area; "B" to the column area; and "A" to the
Data area.

I right-clicked the table; selected Field Options, and changed the Summarize
by: from Sum to Count.

I finally selected Table Options and DE selected the two Grand Totals items and
also selected "For empty cells, show: 0.

You can play around with more formatting, but it seems to do just what you
describe. You do have to refresh the table manually (or use an event macro to
do so).

HTH,

--ron


  #16   Report Post  
Duke Carey
 
Posts: n/a
Default

After copying your data into B29:C37 (and A & B labels into B28 & C28), I was
able to use this formula in a 2 way data table & produce the same results as
in your post

Note that the 'A' value went into B27 - the cell above the 'A' label - and
the 'B' value went into C27

=SUMPRODUCT(--(B29:B37=B27)*--(C29:C37=C27))



"Marc Fleury" wrote:

I'm pretty sure I need an array function for this, but nothing I do
works.

My data is basically two colums:

A B
0 0
0 2
1 0
1 0
1 4
2 1
3 3
3 3
4 0

etc

Now, I need to create a table that counts how many instance of each pair
there are. Like so:

0 1 2 3 4
___________
0 |1 0 1 0 0
1 |2 0 0 0 1
2 |0 1 0 0 0
3 |0 0 0 2 0
4 |1 0 0 0 0


So the upper left cell counts how many times there is a 0 in column A
AND a 0 in colum B (once). The next cell to the right counts how many
times there is a 0 in column A and a 1 in colum B (zero times). Etc.

The closest that I have come is

{=SUM(IF(($A$1:$A$10=0)+($B$1:$B$10=0),1,0))}

I actually have reference cells for the "0" that's being compared to, so
that I can use the same formula for every cell in the table, but I know
how to do that part.

The problem with this formula is that it counts how many times there is
a zero in column A OR a zero in column B.

HELP!

--
Marc.

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
Array functions ARGHH! Marc Fleury Excel Discussion (Misc queries) 1 March 16th 05 08:17 PM
Combination of functions for a conditional format and an array [email protected] Excel Worksheet Functions 0 March 8th 05 06:06 AM
array functions and ISNUMBER() Henrik Excel Worksheet Functions 1 February 10th 05 12:12 AM
Array Functions from Alan Beban Josh O. Excel Worksheet Functions 13 February 5th 05 12:54 AM
Array Functions - Two Questions MDW Excel Worksheet Functions 3 January 12th 05 06:54 PM


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