Array won't read cells

Don C

Board Regular
Joined
Feb 24, 2002
Messages
72
I have a column in which are blanks or the letter "Y" (indicating membership in a group). I can count the Y's with a countif, so I know the entries are clean.

An array formula does not see the Y's however. A simple array, =sum(H2:H100="Y") gives me a zero.

Probably related to this is the fact that a sort on a user defined list will not work either.

Somehow, even though =code(H2) gives me an ascii code of 89, which I think is the correct code for "Y", and countif sees the letters, arrays and sorts don't.

I've tried trims and cleans to no avail.

What else might I do to get this column to be recognized?

TIA
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
On 2002-02-25 13:57, Don C wrote:
I have a column in which are blanks or the letter "Y" (indicating membership in a group). I can count the Y's with a countif, so I know the entries are clean.

An array formula does not see the Y's however. A simple array, =sum(H2:H100="Y") gives me a zero.

Probably related to this is the fact that a sort on a user defined list will not work either.

Somehow, even though =code(H2) gives me an ascii code of 89, which I think is the correct code for "Y", and countif sees the letters, arrays and sorts don't.

I've tried trims and cleans to no avail.

What else might I do to get this column to be recognized?

TIA

Don,

Array-enter:

=SUM((H2:H100="Y")+0)

or enter normally

=SUMPRODUCT((H2:H100="Y")+0)

Note. There is no need for these formulas for a single-condition counting -- COUNTIF is just right for that.

Aladin
 
Upvote 0
Actually, I have a multiple criterion array that is not working. To problem solve what is failing, I tried just counting one segment (this one column) and it is failing to count.

It is my hope that once I find out why the array won't work on ONE criterion, I'll be able to fix it to work in the "real" multiple criterion situation.
 
Upvote 0
Apply

=SUMPRODUCT((TRIM(H2:H100)="Y")+0)

What do we get?

Try also CLEAN instead of TRIM.

Addendum:

What COUNTIF formula did you use:

=COUNTIF(H2:H100,"Y") ?
This message was edited by Aladin Akyurek on 2002-02-25 14:30
 
Upvote 0
On 2002-02-26 06:10, Don C wrote:
=COUNTIF(H2:H100,"Y")

Don,

I'm really grown curious about that range. Is it possible that you sent me a copy of the worksheet trimmed down just to that range?

Aladin
 
Upvote 0
A followup:

I sent a sample of the file to Aladin (who must never go to sleep!) who corrected my placement of parentheses. In the suggested formulas, () need to encompass the +0, which I was not doing.

The "+0" is new to me as well. He calls it coercion, apparently forcing the formula to work in values (?).

Boy is this board (and Aladin in particular) helpful!

Don
 
Upvote 0

Forum statistics

Threads
1,214,411
Messages
6,119,346
Members
448,888
Latest member
Arle8907

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top