Forum Discussion
Formula for playing cards
- Sep 09, 2022correct the prior Column E should have been deleted
so basically 4 cards to an inside straight possibilities. I will see if I can come up with something but it will cost you. jk. but a few likes wouldn't hurt. lol.
No, you do not have to copy anything. Please just run a new calculation of the cells (F9) in Error Test and tell me in which cells (A3:A16) the #NAME? error appears.
dscheikey I don't think any of the new formulas will work for them as they are using 2019. Maybe this will work?
=OR(
AND(ABS(SEARCH(LEFT(A3,1),cards)-SEARCH(MID(A3,4,1),cards))=1,ABS(SEARCH(MID(A3,7,1),cards)-SEARCH(MID(A3,4,1),cards))=1,LEFT(A3,1)<>MID(A3,7,1)),
AND(ABS(SEARCH(MID(A3,7,1),cards)-SEARCH(MID(A3,4,1),cards))=1,ABS(SEARCH(MID(A3,7,1),cards)-SEARCH(LEFT(B3,1),cards))=1,MID(A3,4,1)<>LEFT(B3,1))
)Since there are only 4 cards then either cards 1,2,3 or 2,3,4 need to have a sequence to work ... oh shoot there is another scenario ... the "inside straight draw". I'll think how to add another condition for that ... but for now the attached will look for 3 cards in a sequence. (BTW "cards" is a defined name for the text string "A123456789TJQKA".
Let me know if we are at least going in the right direction.
- mtarlerSep 08, 2022Silver Contributorbased your prior reply I saw that a sequence of 3 could pre-exist and should be detected
also an out of sequence consecutive (inside straight) should also be detected right? (i.e. 3,1,2)
and in 'inside 4 card straight' should be detected right? (i.e. 3,4,1,2)
but not accept if a middle card is not part of the sequences (i.e. 3,4,8,5) should be FALSE
and based on your formula for "Paired" is it true no initial 3 cards will have a pair?- KalthofSep 08, 2022Brass Contributor
You are thinking along the good lines. To give a bit of background information. The data is used for optimal game theory strategies in poker. A strategy is based on the first 3 cards, the flop. The 4th card, the turn, either significantly changes that strategy or not. That is why it has to be the 4th card in combination with the first 3 cards.
2 examples of that strategy changing significantly is the board pairing (AKQQ eg) or a straight draw turning into a potential straight. As you smartly recognized. The most significant change for straights will be when the 4th card leads to 3 or more cards in a row. So it doesn't matter if that 4th card is on the left, middle or right. They all must be TRUE for the formula.
I understand you guys are making progress. Let me know when I can try it out. I very much appreciate you guys working together and helping me with this. Thank you!Ps. I am not 100% sure I have answered your questions with this message. Let me know if I have to clarify something.
About pre-existing(flop) 3 card in a row sequences like 765. Here it also has to be in combination with the 4th card. So when the 4th card(turn) is a K. The strategy doesn't significantly change when the board becomes 765K. On the contrary, if an 8 would come on the board. The strategy changes signficantly.
- mtarlerSep 08, 2022Silver Contributor
Kalthof Ok I re-read the posts again and now back to thinking as long as ANY 3 cards make a sequence of 3 in a row you want it true so try this formula:
=OR( ABS((SEARCH(LEFT(A46,1),cards)-SEARCH(MID(A46,4,1),cards))*(SEARCH(LEFT(A46,1),cards)-SEARCH(MID(A46,7,1),cards))-0.5)=1.5, ABS((SEARCH(LEFT(A46,1),cards)-SEARCH(MID(A46,4,1),cards))*(SEARCH(LEFT(A46,1),cards)-SEARCH(LEFT(B46,1),cards))-0.5)=1.5, ABS((SEARCH(LEFT(A46,1),cards)-SEARCH(MID(A46,7,1),cards))*(SEARCH(LEFT(A46,1),cards)-SEARCH(LEFT(B46,1),cards))-0.5)=1.5, ABS((SEARCH(MID(A46,4,1),cards)-SEARCH(MID(A46,7,1),cards))*(SEARCH(MID(A46,4,1),cards)-SEARCH(LEFT(B46,1),cards))-0.5)=1.5 )- mtarlerSep 08, 2022Silver Contributor
dscheikey thx for the compliment and glad you like the approach.
BTW i thought I would give some explanation to my updated formula (posted above):
basically for any 4 cards there are 4 combinations of 3 cards. If you label them as A,B,C,D then you can group them as:
A,B,C; A,B,D; A,C,D; or B,C,D
to know if any group of 3 cards is a sequence then if you take the difference between one and each of the other 2 and multiply them you must get either -1 or +2 (e.g. 4,5,3 would be +1 * -1 = -1 or 5,4,3 would be -1 * -2 = +2)
So I have 4 lines for those 4 groupings and after I multiply them together I -0.5 so I can then take absolute value and compare with 1.5 (i.e. -1-0.5 = -1.5 or +2-0.5 = 1.5).
Hope that makes some sense 🙂