+ Reply to Thread
Results 1 to 11 of 11

Straight in Poker (Hold'em)

  1. #1
    Registered User
    Join Date
    04-04-2015
    Location
    Vancouver, Canada
    MS-Off Ver
    Office 365
    Posts
    88

    Straight in Poker (Hold'em)

    Hi,
    I don't even know how to word this question without being confusing.. so bare with me.

    I have poker (holdem) hand question. Straights in particular.
    Most of you if not all probably know what a straight in poker is so, my question is:

    If I have a hand with 2 cards that are not paired (AB, but not AA)
    and I have a community card of 3 cards that are also not paired, (ABC, but not AAA, AAB, ABB)
    How do I determine if those 5 cards make a straight?

    I tried to list them in ranking: A, K, Q, J, T, 9, 8, 7, 6, 5, 4, 3, 2
    but since A can be after K AND before 2... I don't know...

    I've listed out whole straight possible hand + board combination that makes a straight.
    The list is pretty long as you can imagine.
    I can post that list if you require but I'm sure there's no need for it.

    To be honest, I don't even know where to start.. Can you help?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,056

    Re: Straight in Poker (Hold'em)

    Can you help?
    Probably not I know nothing about poker. But maybe you could have a helper column or row and use a VLOOKUP to assign numerical values to all the cards from Ace (14), King (13), down to Deuce (2). Then sort the columns, or rows, and check the sequence. If you have a run of 5 ...


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Straight in Poker (Hold'em)

    Hello cocacrave,

    Here's an example, using a helper column as suggested by TMS :
    Attached Files Attached Files
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  4. #4
    Registered User
    Join Date
    04-04-2015
    Location
    Vancouver, Canada
    MS-Off Ver
    Office 365
    Posts
    88

    Re: Straight in Poker (Hold'em)

    Nice, that's perfect.
    However, I require to do this in VBA, is there any way to do this strictly in VBA and, if possible, without typing to cells?

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,056

    Re: Straight in Poker (Hold'em)

    @GC Excel: that's sort of how I envisaged it ... thanks for putting all the hard work in ... but I was thinking the Ace would have a value of 14 to rank it above the King. Aces ARE high, aren't they? But can you have a flush that has Ace low? So , Ace, 2, 3, 4, 5?

  6. #6
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Straight in Poker (Hold'em)

    @cocacrave
    Sure it's possible in VBA but you'll have to input the cards somewhere... no?
    Do you have a sample file?

    @TMS
    In Poker, aces can have a value of 1 or 14, so you can have a "small straight" : A-2-3-4-5 or a "high straight" : A-K-Q-J-T.
    I used the value of 1 per default for the aces and that's why a added this combination : "KQJTA"

  7. #7
    Registered User
    Join Date
    04-04-2015
    Location
    Vancouver, Canada
    MS-Off Ver
    Office 365
    Posts
    88

    Re: Straight in Poker (Hold'em)

    I said above that this was for Holdem, however it is for Omaha Hi.
    The reason I said Holdem was because it is more popular and with what I do below, it won't matter.
    The rules are slightly different in that you have to use two cards (out of four cards) from your hand with three of the community cards.

    I have a macro that checks:
    card1 + card2 on board
    card1 + card3 on board
    card1 + card4 on board
    card2 + card3 on board
    card2 + card4 on board
    card3 + card4 on board

    For example, AAKK on board QJT
    card1(A) + card2(A) on board(QJT) would be one pair
    however, card1(A) + card3(K) on board QJT would be a straight

    And at the end of running through this array loop, it determines what was the highest ranking and writes to a single cell.

    I realize after looking at RANK() function, that you require a table like what you did with yours so I created that table but I don't know how to do the rest on VBA.

  8. #8
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Straight in Poker (Hold'em)

    Hello,

    Here's an example using VBA. Hopefully, you can take it from there :

    Please Login or Register  to view this content.
    You can use the function like this :
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    04-04-2015
    Location
    Vancouver, Canada
    MS-Off Ver
    Office 365
    Posts
    88

    Re: Straight in Poker (Hold'em)

    Wow ur a genius. Thank you for all your help. Sorry for the trouble

  10. #10
    Registered User
    Join Date
    11-11-2022
    Location
    France
    MS-Off Ver
    Windows 13
    Posts
    1

    Re: Straight in Poker (Hold'em)

    Hi there,

    Hope you're all ok.

    Quick question here, I am having trouble to adapt this VBA script so it can find 5 straights cards in a set that is not necessarily 5 cards. Sometimes the set can be composed of 6 or 7 cards.

    Similarly, if the set is 5 - 6 - 7 cards, I'd like to be able to find the highest number of straight cards contained in the set (even if not equal to 5).

    Do you have any recommendation on how to proceed here?

    Cheers

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,056

    Re: Straight in Poker (Hold'em)

    @locosr

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. To hold or not hold CTRL down
    By Sebastian1942 in forum Excel General
    Replies: 2
    Last Post: 05-02-2010, 02:17 PM
  2. straight line graph, really straight line..
    By Jason in forum Excel General
    Replies: 2
    Last Post: 07-20-2006, 05:15 PM
  3. Poker Run Spreadsheet?
    By Brainless in forum Excel General
    Replies: 0
    Last Post: 04-30-2006, 11:33 AM
  4. Betfair Poker
    By scottymelloty in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-29-2006, 01:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1