It is pretty easy if you create bins of equal size on regular measures or dimensions. You can use the right-click context menu "Create Bins" in Tableau to create them.
It becomes tedious when working with aggregated measures (no context menu available for creating bins), especially when the number of bins is big.
The expected bins are like those in the picture:
There are in total 25 bins between 0 and 1. It takes quite sometime to do it by hand. The accuracy of the code is not guaranteed.
So, Excel can do this pretty handily.
1.Create column A for the bin ticks. Excel can do it by incrementing 0.4 per row. Just by dragging down.
2.Create column B of bin labels from 1 to 25. By dragging down again.
3.Create column C for the code based on A and B through the function Concatenate(), plus dragging down.
Then copy the code to the bin creation formula with some edit.
This applies equally to creating variable-size bins. Then you have to create columns A and B manually.
PS.I thought everyone knew this trick in Excel. But it seems not so. Hope this helps.
View comments