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.
I should have clarified better. I enclosed an example where I put in 3 different 3 card examples. In my complete document I have almost 200 different combinations. That gives almost 10.000 rows. So I made a simplified file.
Also I put in the paired column in column C. You don't have to use the method I used there. But I thought maybe leave it in there so it might give you some ideas.
Your method seems to work but I see an issue. It must the be the 4th card that changes the sequence. So if the K on 765 doesn't give a 4th consecutive card. It doesn't count. An 8 or 4 would on the contrary. I understand the misunderstanding because it was already 3 in a row with the first 3 cards. I should have clarified that better as well.
After I filter on true or false I get an #NAME? error by the way. After that I can't undo my last action. All the cells have #NAME? now and I can't filter on true/false anymore. I have to reopen the document to have that option again.
Thank you for your effort so far.
Hello Jeroen, the bad news is that with a #NAME? error, your Excel version does not recognise one of my formulas or functions. Before I can look further into the solution, I need to know which function is not working for you.
Please open the attached sheet and perform a new calculation in the worksheet so that the formulas are recalculated. Which formula(s) do not work?
- KalthofSep 08, 2022Brass ContributorI have to paste the formula in A1 from Error Test in which cell of the worksheet Playing cards?
Do I also have to paste the formulas/functions from cell A3-A16 somewhere?
I have Microsoft Office Home and Student 2019.- dscheikeySep 08, 2022Bronze Contributor
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.
- mtarlerSep 08, 2022Silver Contributor
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.