Benford's law - Generalization to digits beyond the first -- Is there a VBA solution?

Juggler_IN

Active Member
Joined
Nov 19, 2014
Messages
347
Office Version
  1. 2003 or older
Platform
  1. Windows
I am looking for a VBA led output for 2nd, 3rd, 4th, etc, (Generalization to digits beyond the first).

The refrence link is : Benford's law - Wikipedia

Essentially the formula to code is below the text "And the probability that d (d = 0, 1, ..., 9) is encountered as the n-th (n > 1) digit is"

Thanks
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
To replicate the table,

A​
B​
C​
D​
E​
F​
G​
H​
I​
J​
K​
L​
5​
Pos\Digit
0​
1​
2​
3​
4​
5​
6​
7​
8​
9​
6​
1​
n/a​
30.10%​
17.61%​
12.49%​
9.69%​
7.92%​
6.69%​
5.80%​
5.12%​
4.58%​
C6: =LOG(1 + 1/C$5)
7​
2​
11.97%​
11.39%​
10.88%​
10.43%​
10.03%​
9.67%​
9.34%​
9.04%​
8.76%​
8.50%​
B7: =SUMPRODUCT(LOG(1 + 1/(10*ROW(INDIRECT(10^($A7-2) & ":" & 10^($A7-1) - 1)) + B$5)))
8​
3​
10.18%​
10.14%​
10.10%​
10.06%​
10.02%​
9.98%​
9.94%​
9.90%​
9.86%​
9.83%​
9​
4​
10.02%​
10.01%​
10.01%​
10.01%​
10.00%​
10.00%​
9.99%​
9.99%​
9.99%​
9.98%​
10​
5​
10.00%​
10.00%​
10.00%​
10.00%​
10.00%​
10.00%​
10.00%​
10.00%​
10.00%​
10.00%​
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,205
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top