muraterguen
New Member
- Joined
- Jan 8, 2016
- Messages
- 25
I am trying to make Excel to recognize straight flush combinations with 3 or more cards. (This is a game known as Rhum32, a rummy version) Basically the cards of the straight flush should return ZERO value and the unrelated cards' values must be summed. See the table below, unfortunately the site doesnt allow me to insert an image or a link (i think i managed to add an image)
I have created a table with 52 cards, face values and some given values to use for my formulas. The formula I made works for the first suit (spades) on top but when i enter a different combination from another suit, it fails. I cant find the reason. Trying to solve this with formulas, not VBA.
Any help ?
CARDS "A" HIGHER COL C - CARDS "#" FIRST COL D - FACE VALUE COL E - FORMULA VALUE 1 COL F - FORMULA VALUE 2 COL G - DIFFERENCE CHECK (VALUE 2) COL H
♠2 2♠ 2 1.3 1.01 0
♠3 3♠ 3 2.3 1.02 0.01
♠4 4♠ 4 3.3 1.03 0.01
♠5 5♠ 5 4.3 1.04 0.01
♠6 6♠ 6 5.3 1.05 0.01
♠7 7♠ 7 6.3 1.06 0.01
♠8 8♠ 8 7.3 1.07 0.01
♠9 9♠ 9 8.3 1.08 0.01
♠10 10♠ 10 9.3 1.09 0.01
♠V J♠ 10 10.3 1.1 0.01
♠Q Q♠ 10 11.3 1.11 0.01
♠K K♠ 10 12.3 1.12 0.01
♠A A♠ 1 13.3 1.13 0.01
♥2 2♥ 2 1.2 2.01 0.88
♥3 3♥ 3 2.2 2.02 0.01
♥4 4♥ 4 3.2 2.03 0.01
♥5 5♥ 5 4.2 2.04 0.01
♥6 6♥ 6 5.2 2.05 0.01
♥7 7♥ 7 6.2 2.06 0.01
♥8 8♥ 8 7.2 2.07 0.01
♥9 9♥ 9 8.2 2.08 0.01
COLUMNS
N O P Q R S
♠2 ♠3 ♠4 ♥V ♦4 TOTAL (ROW 14)
0 0 0 10 4 14 (ROW 15)
THE FORMULA IN CELL N 15
=IF(AND((VLOOKUP(P14,$C$2:$G$53,5,FALSE)-VLOOKUP(O14,$C$2:$G$53,5,FALSE)=0.01),(VLOOKUP(O14,$C$2:$G$53,5,FALSE)-VLOOKUP(N14,$C$2:$G$53,5,FALSE)=0.01)),0,VLOOKUP(N14,$C$2:$G$53,3,FALSE))
O 15
=IF(AND((VLOOKUP(O14,$C$2:$G$53,5,FALSE)-VLOOKUP(N14,$C$2:$G$53,5,FALSE)=0.01),((VLOOKUP(P14,$C$2:$G$53,5,FALSE)-VLOOKUP(O14,$C$2:$G$53,5,FALSE)=0.01))),0,VLOOKUP(O14,$C$2:$G$53,3,FALSE))
P 15
=IF(AND((VLOOKUP(P14,$C$2:$G$53,5,FALSE)-VLOOKUP(O14,$C$2:$G$53,5,FALSE)=0.01),(VLOOKUP(O14,$C$2:$G$53,5,FALSE)-VLOOKUP(N14,$C$2:$G$53,5,FALSE)=0.01)),0,VLOOKUP(P14,$C$2:$G$53,3,FALSE))
AND SO ON...
Please get the file from the below link if you like
*ADD h
ttps://drive.google.com/open?id=19W6hNHUh-DNGjh8JYJY3Pg52cnptWp09
Thanks
NOTE: I HAVE POSTED ON THE BELOW FORUM
https://www.excelforum.com/excel-fo...-straight-flush-combinations.html#post5114835
Last edited: