external image

Dummie Working On A BJ Audit Has An Excel ?

NASHVEGAS

Banned User - flamming, disrespecting admin,
Joined
Dec 10, 2006
Location
MERS
If anyone is an EXCEL 2003 expert for dummies, I have a question on the easiest way (read some complicated ones I think:o) if possible with a hand history to convert text or a string of text in a column to numeric values so I do not have to keep totaling each hand (over 100K total hands/rows) row by row. A sample of 10 rows and 2 columns (not aligning) below:


Qd,Tc​
20​
3s,5c,Kd​
18​
5c,5c,6c,5d​
21​
Ac,4c,2s,6h,3h,Ks
26​
6d,8s,Tc
24​
Qd,3s,2c,8h
23​
5h,Qc,Qd
25​
Td,Ks
20​
Th,7s
17​
8c,4h
12​

P.S.-Never have done an EXCEL macro (or separate worksheet even) if that is the way to go but I can follow detailed instructions for dummies:confused:

TIA,NV:)
 
Nash, do you know how to enter (sum=) for the rows and columns and create your formula ??

Example: =N10+N11+SUM(N10:N11)
That I do or I use the auto sum button for the basics. Never have used it to add text (and numbers) though ,LOL, but I have an idea ,well sorta, on what you may instruct. Thanks for any help!!
 
That I do or I use the auto sum button for the basics. Never have used it to add text (and numbers) though ,LOL, but I have an idea ,well sorta, on what you may instruct. Thanks for any help!!

Ok, in your formula you need to assign values to the K,Q & J of 10 and an 11 or 1 to the "A" but that could also be a little tricky since the "A" may have been used as a 1 or 11...let me check something here...be back in a few :D
 
Last edited:
Hurry back Rob;)
No rush, Falcons in a close and important one, in the 4th .:eek:


woohooo Gators:thumbsup:
#1 in the AP poll but who knows with the BCS until a done deal:rolleyes:

Go Titans:cool:
28-9 in the 4th:eek2:

Going to check all those formula's et al out again later unless someone can lead this horse to water with the correct formula. Have to account for the suits of each card and although there is prolly a if,then,>,< way to account for the Aces, prolly simplier just to assign an 11 value to all 4 Aces and manually correct values that equal 1. Will stay the course of row by row which is time consuming but could be beneficial (not statiscally) also.
 
Going to check all those formula's et al out again later unless someone can lead this horse to water with the correct formula. Have to account for the suits of each card and although there is prolly a if,then,>,< way to account for the Aces, prolly simplier just to assign an 11 value to all 4 Aces and manually correct values that equal 1. Will stay the course of row by row which is time consuming but could be beneficial (not statiscally) also.

I'm stuck...:o Can't figure out how to account for the different value of the aces and it is most likely something real simple too but just can't manage to decipher it thru the fog...
 
I'm stuck...:o Can't figure out how to account for the different value of the aces and it is most likely something real simple too but just can't manage to decipher it thru the fog...
Appreciate you trying. Can't expect us construction guys to know everything but just about everything,LOL:thumbsup:
 
I assume that the "suit" (c,d,h,s) does not matter.
I have been able to separate the one column into 6 columns not including the total.
The next step is to convert K's. Q's, J's to = 10 then remove the "suits" convert the Ace and SHAZAM LOL We got it
Havent used excel in years so will work on it
 
I assume that the "suit" (c,d,h,s) does not matter.
I have been able to separate the one column into 6 columns not including the total.
The next step is to convert K's. Q's, J's to = 10 then remove the "suits" convert the Ace and SHAZAM LOL We got it
Havent used excel in years so will work on it
Well I'm quite good with Excel - but this is a toughie!
I could do it, but I would do it the long (dummies) way - requiring 4 extra columns per card to start with, then a few more at the end to handle the 'Ace' issue:-
(This was done on Excel 97 - hopefully the newer versions are similar!)

First, (assuming the suits are not important!) get rid of all the suit letters & the commas, and have 1 card per column;

Highlight all the cells with the data in, click 'Data', 'Text to columns', 'Fixed width', 'Next'.
Here put a break between each symbol (shown half-done in this screenie):-

Old Attachment (Invalid)

The result is at the top of this next picture.
Remove the unwanted columns, and you'll end up with the bottom part of this picture:-

Old Attachment (Invalid)

For each card (or column), add formulas in 4 more columns to give values of 11 for Aces & 10 for picture cards. I have shown the 'IF' formulas in blue under the cells. (Only shown for column 'A' in my shot).
Do a sum at the end for the entire row starting from column A.

In the columns to the right of your answer, add the second bit below to account for the Aces.
(Here shown underneath instead):-

Old Attachment (Invalid)

Copy & Paste these formula all the way down your spreadsheet.
A bit long winded - but quite simple I think...?

Errr.... Now you have ended up with the total you had in the first palce... what was the question again? :p

KK
 
For each card (or column), add formulas in 4 more columns to give values of 11 for Aces & 10 for picture cards. I have shown the 'IF' formulas in blue under the cells. (Only shown for column 'A' in my shot).
Do a sum at the end for the entire row starting from column A.

But doesn't that assume the Ace is always counting for 11, which isn't the case?
I imagine the tricky bit is whether the Ace is 1 or 11.

Woooof


Ooops, I really should read to the end of the post...ignore me...:rolleyes:
 
Last edited:
Very good KK!!! Although I got as far as you have shown here:-))
In order to determine the Value of the Ace,maybe we could use the given TOTAL and then use a real sloppy formula to determine if the ACE was used as an 11 or a 1.
Remember we can always hide all these fomulas and just show the results the OP desire..Will work on it today instead of playing video poker It's less expensive and more mentally stimulating.
 
Thanks KK:thumbsup:

I really did figure out prior to my OP post how to use the Convert Text To Columns Wizard as you can see in the lovely screenshot (showing how the hand histories were delivered-colors by moi,ftr) below to get the dealer's and player's hands in their own column(s)-a nightmare with doubled splits hands,imagine 4- but it is done. Also notice the player's hands were totaled so those totals went right into their own column (except the splits which is my bad but I cleaned the mess up).

Wonder why they do not total the dealer's hand??? Anyway, I have already totaled about 10000 dealer's hands row by row in order to create different preliminary databases (sorted) and takes longer to total than you would think. Need to do all plus to get as large a sample size as possible, I requested the balance of my hand histories and hopefully will have very soon.

KK, your mention of how to use the breakers (I did not know) will make some of the "not as easy" analysis I intend to do much easier once I get the dealer's hands totaled following your instructions. Gotta let the neurotransmitters rest before I attempt though.:what:;)....MUCH OBLIGE,KK:)

Rob, any conspiracy theories on why the dealer's hands are, now were:rolleyes:, presented before the player's and the dealer's hand are not totaled?? LOLOL:D:D
 
Last edited:
Very good KK!!! Although I got as far as you have shown here:-))
In order to determine the Value of the Ace,maybe we could use the given TOTAL and then use a real sloppy formula to determine if the ACE was used as an 11 or a 1.
Remember we can always hide all these fomulas and just show the results the OP desire..Will work on it today instead of playing video poker It's less expensive and more mentally stimulating.
Having been retired for awhile, I agree the mental stimulation and being productive is enjoyable.:thumbsup:
 
Thanks KK:thumbsup:

I really did figure out prior to my OP post how to use the Convert Text To Columns Wizard as you can see in the lovely screenshot (showing how the hand histories were delivered-colors by moi,ftr) below to get the dealer's and player's hands in their own column(s)-a nightmare with doubled splits hands,imagine 4- but it is done. Also notice the player's hands were totaled so those totals went right into their own column (except the splits which is my bad but I cleaned the mess up).

Wonder why they do not total the dealer's hand??? Anyway, I have already totaled about 10000 dealer's hands row by row in order to create different preliminary databases (sorted) and takes longer to total than you would think. Need to do all plus to get as large a sample size as possible, I requested the balance of my hand histories and hopefully will have very soon.

KK, your mention of how to use the breakers (I did not know) will make some of the "not as easy" analysis I intend to do much easier once I get the dealer's hands totaled following your instructions. Gotta let the neurotransmitters rest before I attempt though.:what:;)....MUCH OBLIGE,KK:)

Rob, any conspiracy theories on why the dealer's hands are, now were:rolleyes:, presented before the player's and the dealer's hand are not totaled?? LOLOL:D:D

Simple Alphabetization I would imagine on that one...

The Dealers Hands not being totaled should be due to the way the formula was written and entered but I'm not 100% certain on either one of those...:)
 
In the columns to the right of your answer, add the second bit below to account for the Aces.
(Here shown underneath instead):-

Old Attachment (Invalid)
OK, re-visiting this a bit later I can see this Ace calculation is WRONG & does not work for all possible combinations of cards :o
At the moment I can't see a way around this; I need an 'IF A>X and B<Y then...' function, but I can't find it on Excel...
:confused:

Anyway - looks like Nash is sorted now, so I wont waste any more time on this.
KK
 
Anyway - looks like Nash is sorted now, so I wont waste any more time on this.
KK
Part I of your instructions went perfect and have been completed. Screenshot below:thumbsup:

Not sure on Part II but may see if your formulas work for the Tens and will autofill all cells with Aces with an error (ACE=PI R SQUARED:what::D) or 11 and I can manually total. The objective (for this virgin auditor aka dummie) at least for the most basic analysis of Dealer hands is Columns S and T of the second screenshot below.

Somehow I have accomplished S. Column T is simple addition but if I can avoid further row by row human addition aka finger counting:D then so much time is saved even if I manually have to correct and/or proof every cell with an ACE.....Just thinking (that's the real problem), if no formula is presented and/or possible why not have the ACE'S be 11 so most ACE errors would be apparent although I would still have to check every hand with an ACE. Thoughts welcome as I am tired and may not be thinking clearly. OK, I never think clearly:p
 
Last edited:
OK, re-visiting this a bit later I can see this Ace calculation is WRONG & does not work for all possible combinations of cards :o
At the moment I can't see a way around this; I need an 'IF A>X and B<Y then...' function, but I can't find it on Excel...
:confused:

Anyway - looks like Nash is sorted now, so I wont waste any more time on this.
KK

Maybe a sort command wherein the ace, if one or more, always appears in the last column(s) and then the value for aces in a vlookup table depends on the sum of the previous column(s). Just a thought.
 
Maybe a sort command wherein the ace, if one or more, always appears in the last column(s) and then the value for aces in a vlookup table depends on the sum of the previous column(s). Just a thought.

Probably a good idea but you still need to justify a way to determine when (as in what scenario) the Ace is valued as 11 verses 1 and then this would be the table rule to formulate the insert per say...
 
Okay, bit of an easier solution from my guru brother:

.....
In the Excel Spreadsheet with the hands:

Hit Alt-F8 to open Macros Dialog Box

Type GetValues in Macro Name:

Hit Create to open the Visual Basic Editor.

Copy in the following macro (delete any other text appearing in the create macro area):



Sub GetValues()

Dim r, c, v, a, aces, value As Integer

For r = 1 To Selection.Rows.Count

aces = 0

value = 0

With Selection.Cells(r, 1)

For c = 1 To .Characters.Count

v = CInt(Val(.Characters(c, 1).Text))

value = value + v

If v = 0 Then

Select Case .Characters(c, 1).Text

Case "A"

aces = aces + 1

Case "K", "Q", "J", "T"

value = value + 10

End Select

End If

Next c

End With

If (aces > 0) And (value < 11) Then

value = value + 11

aces = aces - 1

End If

value = value + aces

Selection.Offset(0, 1).Cells(r, 1) = value

Next r

End Sub



Hit Save (to anywhere, name it anything) and then Alt-Q to close Visual Basic Editor.

Hit Alt-F8 to open the Macros Dialog Box again.

Hit Options

Type t in Shortcut Key: (or any other letter you want)

Enter or OK

Hit Cancel

................
The macro is now ready to use.

To use it:

Select a group of hands (any number of rows within 1 column), or just select entire column

hit Ctrl-t

The hand values will appear in the right adjacent column.
If you've selected the entire column, hit ESC to end the macro

Woooof
 
Thanks Rob,KK,BryanD,Stovetopp,Woof et Jaz U2

I went the following route. Mission accomplished afaic:thumbsup:.

From hands 50,000 to 97,000+, the Dealer's largest number of cards in a single hand was 7. Thus, I used KK's "IF formula's" to assign values to the 3 face cards as well the T or 10 card so there were actually 5 Cards represented by Text rather than the 4 KK mentions. KK was still the Keyman to my ~90% more efficient solution for now.:)

Since the largest number of cards in a hand is 7 in the current group, I had to set up 5 text to numbers formulas for each card for a total of 35 in a row of cells plus a 36th formula that merges and totals the 35 converted text to number values with the original numbers as listed in the provided hand histories.

As far as the ACES, I used my own fully certified and tested by Bear Stearns, AIG, and Lehman Bros., 125 year old RNG that has been preserved in both the vaults of Wachovia and WaMu to insure 100% fairness. The RNG determined the value for the ACES. The number was neither 1 or 11 but one can not argue with the RNG as the number was 111. Must be a minor glitch but not a big deal. Afterall, 111 is really the same as 1 and 11:eek:.

With the just kidding aside, I will now simply go adjust all hands that had ACES accordingly and used 111 for all ACES so those hands requiring manual adjustment would be obvious and easy to recognize. Thus, with the help I received the time necessary to complete organizing the data (I have,hurry please with the balance) has probably been reduced by ~90% as previouly mentioned.

Once I complete organizing the data , then simple but important BJ analysis such as BJ's, 2 Card 20's, Dealer Upcard Distribution, Dealer Final Totals, Win/Lose/Push %'s*, Bust Rates*, Etc.,can proceed. Furthermore, where applicable for both the dealer and/or player the results can be compared to known statisical expectation. This can all be done very quickly.

Other analysis will take more time for several reasons.

I also will have to remove my played hands that deviate (guessing a few hundred hands out of 100,000 plus) from Basic Strategy (see prior asterisks above also). My BS deviation occurs at times from just playing too fast, visiting LaLa Land on occasion, sometimes on purpose by moi and a 4th reason beyond any player's control.

A small sample below of how the data looks after the sample formulas were posted by KK and the dummie (moi) ran with them,lol....The totals on the right took about 20 minutes to total 47,000 hands once the formulas were completed........The numbers on the left about 8 or 9 hours to manually total row by row ~10,000 hands with ~ 90,000 remaining prior to today. Many thanks:)



Qh,Kc
20​
20​
2c,4d,3d,8s
17​
17​
As,9h
20​
120​
Td,3s,Qd
23​
23​
6c,2d,Kd
18​
18​
Ks,As
21​
121​
2h,8c,Jc
20​
20​
 
Last edited:
Okay, bit of an easier solution from my guru brother:

.....
In the Excel Spreadsheet with the hands:

Hit Alt-F8 to open Macros Dialog Box

Type GetValues in Macro Name:

Hit Create to open the Visual Basic Editor.

Copy in the following macro (delete any other text appearing in the create macro area):



Sub GetValues()

Dim r, c, v, a, aces, value As Integer

For r = 1 To Selection.Rows.Count

aces = 0

value = 0

With Selection.Cells(r, 1)

For c = 1 To .Characters.Count

v = CInt(Val(.Characters(c, 1).Text))

value = value + v

If v = 0 Then

Select Case .Characters(c, 1).Text

Case "A"

aces = aces + 1

Case "K", "Q", "J", "T"

value = value + 10

End Select

End If

Next c

End With

If (aces > 0) And (value < 11) Then

value = value + 11

aces = aces - 1

End If

value = value + aces

Selection.Offset(0, 1).Cells(r, 1) = value

Next r

End Sub



Hit Save (to anywhere, name it anything) and then Alt-Q to close Visual Basic Editor.

Hit Alt-F8 to open the Macros Dialog Box again.

Hit Options

Type t in Shortcut Key: (or any other letter you want)

Enter or OK

Hit Cancel

................
The macro is now ready to use.

To use it:

Select a group of hands (any number of rows within 1 column), or just select entire column

hit Ctrl-t

The hand values will appear in the right adjacent column.
If you've selected the entire column, hit ESC to end the macro

Woooof
Thanks and read something similar a couple days ago but had not read your post until now and as I mention in my original post, I have never used a macro so prolly was not up to the challenge.

That said, your post is clearer and more detailed than what I read in regards elsewhere and the dummie (moi) is getting cocky,lol. Have 50000+ more hands currently in hand (npi) to total so I will attempt to lose my macro virginity. Always enjoy learning and appreciate your knowledge and post:thumbsup:
 
Thanks and read something similar a couple days ago but had not read your post until now and as I mention in my original post, I have never used a macro so prolly was not up to the challenge.

That said, your post is clearer and more detailed than what I read in regards elsewhere and the dummie (moi) is getting cocky,lol. Have 50000+ more hands currently in hand (npi) to total so I will attempt to lose my macro virginity. Always enjoy learning and appreciate your knowledge and post:thumbsup:

No worries, let me know if you run into difficulties.
I tested it after my bro sent it across and it generated the entire column in seconds, so if you can get it to work it'll be useful. Good luck!

Woooof
 
No worries, let me know if you run into difficulties.
I tested it after my bro sent it across and it generated the entire column in seconds, so if you can get it to work it'll be useful. Good luck!

Woooof
Will try it for the learning experience and if successful will save me some time but not much. Will let you know how it goes.

In actuality, I just needed the formula to simply convert the 4 text 10's to 4 numeric 10's and the ACES to 111 despite my post above about randomly selecting 111. I really was not concerned about the Aces per se and 111 was the key magic, lol, for a real dummie:D.

I am not sure why but I, yes just moi, had realized that by using 111 (well duh the same as 11;) but still a reason not to just default all ACES to 11) as the numeric value for Aces, that all hands with 2 and 3 cards and only one ACE as in Blackjack ,lol, could simply be handled very quickly with the "find and replace all" function to change all values of 121 to 21, 120 to 20, 119 to 19 ,118 to 18, 117 to 17 and so forth to 112 with 12. Took about 5 minutes to change those hands which corrected ~ 70% to 75% of hands with ACES. Then to be safe I simply manually checked the remaining cells with ACES despite some more magic of 111 :D but not a 100% corrrelation. About another hour or so.
 
Will try it for the learning experience and if successful will save me some time but not much. Will let you know how it goes.

In actuality, I just needed the formula to simply convert the 4 text 10's to 4 numeric 10's and the ACES to 111 despite my post above about randomly selecting 111. I really was not concerned about the Aces per se and 111 was the key magic, lol, for a real dummie:D.

I am not sure why but I, yes just moi, had realized that by using 111 (well duh the same as 11;) but still a reason not to just default all ACES to 11) as the numeric value for Aces, that all hands with 2 and 3 cards and only one ACE as in Blackjack ,lol, could simply be handled very quickly with the "find and replace all" function to change all values of 121 to 21, 120 to 20, 119 to 19 ,118 to 18, 117 to 17 and so forth to 112 with 12. Took about 5 minutes to change those hands which corrected ~ 70% to 75% of hands with ACES. Then to be safe I simply manually checked the remaining cells with ACES despite some more magic of 111 :D but not a 100% corrrelation. About another hour or so.
OOPS, bold above should read "and so forth to 113 with 13". The "find and replace all value" for 12 was 222. (A,A=111+111)....I'll do better proofing next time. Glad GM must not be around:lolup:
 

Users who are viewing this thread

Accredited Casinos

Read about our rating system and how it's done.
Back
Top