# How to use Excel to validate a dataset according to Benford’s Law

Benford’s Law describes the phenomenon that in a large dataset, the leading digit of each number does not occur with the intuitively expected probability of 1:9 (11.1%), but rather with a much larger probability for the smaller numbers. For more details on Benfords’s Law, you can read the Wikipedia Article about it, but keep on reading here if you want to learn how to use Excel to check if a dataset is consistent with it. It’s very easy!

For this example I have used population data for all the counties of the United States from census.gov:

# How to handle parts per million, basis points and per mille in Excel

Excel has built-in functionality to handle percent (%), but there is no automatic way to calculate parts per million, basis points, permyriad or per mille in Excel. It is easy to calculate though, but let’s start with the definitions:

And here’s how to apply it:

# How to calculate prices and make them end with a certain number in Excel

When you calculate prices you usually know the cost price and the desired profit percentage, so all you have to do is to add the profit to the cost price in order to calculate the sales price. However, the price list might not look as nice as you want:

# Join cells in Excel and remove excess commas between elements

EDIT: If you are using Excel 2019 or Office 365 you can use the TEXTJOIN function to solve this problem. Click here for the new article:

How to Join Text from Several Cells in Excel using TEXTJOIN

Unclean data can cause a lot of problems in Excel. In this post I will show how you can join data from different columns with a comma between them. That’s the easy part. The problem occurs when you have empty cells in your data, like in the table below. The result of the first row looks fine, but if you look at the rows with empty cells, you get too many commas: