Re: array formula Excel 97 (Poker)

From: Harlan Grove (hrlngrv_at_aol.com)
Date: 04/20/04


Date: Tue, 20 Apr 2004 13:09:55 GMT


"Jason Morin" wrote...
>You could use:
>
>=IF(SUM(N(COUNTIF(A2:A7,A1-{1,2,3,4})>=1))=4,1,"")

OP wanted 0 when no straight, so could be condensed to

=--(AND(COUNTIF(A2:A7,A1-{1,2,3,4})))

>Array-entered (press ctrl/shift/enter). However, wouldn't

No. Since the array trigger is a constant array, and the outermost function is
SUM, array entry is unnecessary.

>something like an 11,12,13,1,2 be considered a straight as
>well? If so, this formula wouldn't work in that instance.
..

Ace high straights should always be allowed. Sometimes ace low straights, 1..5,
should also be allowed, but J/Q/K/A/2 has never been a straight in any hand I've
played. But how to handle ace high, so A1 == 1?

=--(AND(COUNTIF(A2:A7,IF(A1=1,14,A1)-{1,2,3,4})))

--
To top-post is human, to bottom-post and snip is sublime.