-1

我有一个大数据集,我希望根据本福德定律对其进行测试。

到目前为止,我一直在提取第一个数字,并根据它创建一个图表

=LEFT(A1,1)*1

我将公式乘以 1,因为 LEFT 将数字变成了字符串。

我希望自动化这个过程。有没有办法用 VBA 或更简单/更优雅的公式来做到这一点?

4

2 回答 2

0

Here's a thought.

Let's assume your data is in cells A1:A100 and your workbook is named "Benford".

  • Using the Name Manager on the Insert tab of the ribbon, create a new named range, say, "digits", defined as =VALUE(LEFT(A1:100,1)). The Name Manager will automatically treat the result of this equation as an array.

  • Insert a chart into the workbook without selecting a data range. The chart will be totally blank.

  • Select the chart and then in the Chart Tools tab, press the 'Select Data' button.

  • When the 'Select Data Source' dialog box opens up, again do not specify a data range, but instead click on 'Add Series'.

  • In the 'Edit Series' box that comes up, set the 'Series value' to =Benford!digits. The workbook reference is important: Excel won't accept the bare defined name here.

  • If initially the data does not show on the chart, just manually recalculate the sheet with the F9 key.

You can then add titles, axis labels, etc., as needed.

This can be automated via VBA; whether that makes sense depends on your needs.

于 2013-04-26T03:05:33.413 回答
-1

我相信您可以像使用任何人一样使用 Google。我搜索了“本福德定律的 excel 公式”。我很确定第一个结果就是你要找的。

这是链接: http ://www.isaca.org/Journal/Past-Issues/2010/Volume-1/Pages/Using-Spreadsheets-and-Benford-s-Law-to-Test-Accounting-Data1.aspx

它涵盖了测试前导数字、如何使用本福德定律以及一些有用的注意事项。这应该让你大部分时间。

仅供参考 - ISACA 是一个审计标准组织。他们的内容旨在用于专业应用程序。

祝你好运!

于 2013-04-26T01:00:13.263 回答