Helpful New Functions: ALL and ANY

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'd really like Excel to have an All(range, criteria) function, as used in a
number of programming languages. For instance:

A B C D
1 y y y n
2
3


=ALL(A1:C1, "y") --> TRUE
=ALL(A1:D1, "y") --> FALSE

In a similar vein, the ANY function would be quite handy:

=ANY(A1:C1, "y") --> TRUE
=ANY(A1:C1, "n") --> TRUE
=ANY(A1:C1, "o") --> FALSE

Anyone else think so?

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...dg=microsoft.public.excel.worksheet.functions
 
Think ..
=ALL(A1:C1, "y") --> TRUE
=ALL(A1:D1, "y") --> FALSE

would be the same as using:
=COUNTIF(A1:C1,"y")=COLUMNS(A1:C1)
=COUNTIF(A1:D1,"y")=COLUMNS(A1:D1)

and ..
=ANY(A1:C1, "y") --> TRUE
=ANY(A1:C1, "n") --> TRUE
=ANY(A1:C1, "o") --> FALSE

would be the same as using:
=COUNTIF(A1:C1,"y")>0
=COUNTIF(A1:C1,"n")>0
=COUNTIF(A1:C1,"o")>0

---
 
See your previous post.

--
HTH

Bob Phillips

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

Atreides said:
I'd really like Excel to have an All(range, criteria) function, as used in a
number of programming languages. For instance:

A B C D
1 y y y n
2
3


=ALL(A1:C1, "y") --> TRUE
=ALL(A1:D1, "y") --> FALSE

In a similar vein, the ANY function would be quite handy:

=ANY(A1:C1, "y") --> TRUE
=ANY(A1:C1, "n") --> TRUE
=ANY(A1:C1, "o") --> FALSE

Anyone else think so?

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.
http://www.microsoft.com/office/com...dg=microsoft.public.excel.worksheet.functions
 
I'd really like Excel to have an All(range, criteria) function, as used in a
number of programming languages. For instance:

A B C D
1 y y y n
2
3


=ALL(A1:C1, "y") --> TRUE
=ALL(A1:D1, "y") --> FALSE

In a similar vein, the ANY function would be quite handy:

=ANY(A1:C1, "y") --> TRUE
=ANY(A1:C1, "n") --> TRUE
=ANY(A1:C1, "o") --> FALSE

Anyone else think so?


You could always use the array entered formulas:

=AND(rng="y") for ALL

and

=OR(rng="y") for ANY


--ron
 
Atreides said:
I'd really like Excel to have an All(range, criteria) function, as used in
a
number of programming languages. For instance:


Just out of curiosity, can you tell me a programming language other than SQL
that has an ALL or ANY function?
 
Back
Top