Bird
Raised Fist0
Tableaubi_tool~10 mins

Creating bins in Tableau - Formula Evaluation Walkthrough

Choose your learning style10 modes available
Sample Data

Sales amounts for 9 transactions.

CellValue
A1Sales
A2120
A3250
A4430
A5310
A690
A7600
A8470
A9150
A10380
Formula Trace
IF [Sales] < 200 THEN 'Low' ELSEIF [Sales] < 400 THEN 'Medium' ELSE 'High' END
Step 1: Evaluate [Sales] for row 2: 120
Step 2: Check if 120 < 200
Step 3: Assign bin 'Low' for 120
Step 4: Evaluate [Sales] for row 3: 250
Step 5: Check if 250 < 200
Step 6: Check if 250 < 400
Step 7: Assign bin 'Medium' for 250
Step 8: Evaluate [Sales] for row 7: 600
Step 9: Check if 600 < 200
Step 10: Check if 600 < 400
Step 11: Assign bin 'High' for 600
Cell Reference Map
    A   
  +-----+
1 |Sales|
2 | 120 | --> Used in binning
3 | 250 | --> Used in binning
4 | 430 |
5 | 310 |
6 |  90 |
7 | 600 | --> Used in binning
8 | 470 |
9 | 150 |
10| 380 |
The formula uses the Sales values in column A to assign bins.
Result
    A      B    
  +-------+-------+
1 | Sales | Bin   |
2 | 120   | Low   |
3 | 250   | Medium|
4 | 430   | High  |
5 | 310   | Medium|
6 |  90   | Low   |
7 | 600   | High  |
8 | 470   | High  |
9 | 150   | Low   |
10| 380   | Medium|
Each sales value is assigned a bin: 'Low' for less than 200, 'Medium' for 200 to less than 400, and 'High' for 400 or more.
Sheet Trace Quiz - 3 Questions
Test your understanding
What bin is assigned to a sales value of 150?
AMedium
BLow
CHigh
DNone
Key Result
IF [Sales] < 200 THEN 'Low' ELSEIF [Sales] < 400 THEN 'Medium' ELSE 'High' END

Practice

(1/5)
1. What is the main purpose of creating bins in Tableau?
easy
A. To create calculated fields for text data
B. To join two tables based on a key
C. To filter out null values from a dataset
D. To group continuous numeric data into ranges for easier analysis

Solution

  1. Step 1: Understand what bins do in Tableau

    Bins group continuous numeric data into ranges or intervals to simplify analysis.
  2. Step 2: Compare options to the bin concept

    Only To group continuous numeric data into ranges for easier analysis describes grouping numeric data into ranges, which matches bins' purpose.
  3. Final Answer:

    To group continuous numeric data into ranges for easier analysis -> Option D
  4. Quick Check:

    Bins = Group numeric data into ranges [OK]
Hint: Bins group numbers into ranges for simpler analysis [OK]
Common Mistakes:
  • Confusing bins with filters
  • Thinking bins apply to text data
  • Assuming bins join tables
2. Which of the following is the correct way to create bins in Tableau?
easy
A. Right-click a numeric field and select 'Create > Bins'
B. Drag a dimension to the Columns shelf and select 'Create > Bins'
C. Right-click a text field and select 'Create > Bins'
D. Use the Data menu and select 'Create > Calculated Field'

Solution

  1. Step 1: Recall the bin creation method in Tableau

    You create bins by right-clicking a numeric field and choosing 'Create > Bins'.
  2. Step 2: Check each option against this method

    Only Right-click a numeric field and select 'Create > Bins' matches the correct method; others either use wrong field types or wrong menu options.
  3. Final Answer:

    Right-click a numeric field and select 'Create > Bins' -> Option A
  4. Quick Check:

    Create bins = Right-click numeric field > Create > Bins [OK]
Hint: Bins come from right-clicking numeric fields, not text [OK]
Common Mistakes:
  • Trying to create bins from text fields
  • Using the Data menu instead of field context menu
  • Dragging dimensions instead of numeric fields
3. Given a numeric field 'Sales' with values from 0 to 1000, if you create bins with a size of 200, how many bins will Tableau create?
medium
A. 4
B. 6
C. 5
D. 10

Solution

  1. Step 1: Calculate the number of bins using Tableau's formula

    Number of bins = floor(1000 / 200) - floor(0 / 200) + 1 = 5 - 0 + 1 = 6 bins.
  2. Step 2: Confirm Tableau binning

    Tableau uses floor(value / size) * size for bin start: bins at 0, 200, 400, 600, 800 covering 0-200, 200-400, 400-600, 600-800, 800-1000.
  3. Step 3: Correct the calculation

    Since max value is 1000 and bin size is 200, bins start at 0, 200, 400, 600, 800 covering up to 1000, so total bins = 5.
  4. Final Answer:

    5 -> Option C
  5. Quick Check:

    floor(1000/200) - floor(0/200) + 1 = 6 but last bin covers 1000-1200 which is beyond max, Tableau creates 5 bins covering data [OK]
Hint: floor(max/size) - floor(min/size) + 1 usually, but check max coverage [OK]
Common Mistakes:
  • Calculating range / size = 5 without endpoint adjustment
  • Confusing bin size with number of bins
  • Assuming bins start at 1 instead of 0
4. You created bins on a numeric field but Tableau shows an error: 'Cannot create bins on this field.' What is the most likely cause?
medium
A. The field is a string or non-numeric data type
B. The data source is not connected
C. The bin size is set to zero
D. The field is a dimension, not a measure

Solution

  1. Step 1: Understand bin creation requirements

    Bins can only be created on numeric fields. If the field is string or non-numeric, Tableau cannot create bins.
  2. Step 2: Analyze error causes

    The field is a string or non-numeric data type matches the cause: field is non-numeric. Other options are less likely or unrelated to this error.
  3. Final Answer:

    The field is a string or non-numeric data type -> Option A
  4. Quick Check:

    Bins need numeric fields, non-numeric causes error [OK]
Hint: Bins require numeric fields; strings cause errors [OK]
Common Mistakes:
  • Trying to create bins on text fields
  • Assuming bin size zero causes this error
  • Ignoring data source connection issues
5. You want to analyze customer ages grouped in 10-year ranges using bins. The 'Age' field ranges from 18 to 72. Which bin size should you choose to create exactly 6 bins covering all ages?
hard
A. 9
B. 11
C. 13
D. 10

Solution

  1. Step 1: Recall Tableau's bin count formula

    Number of bins = floor(72 / size) - floor(18 / size) + 1. Need this = 6.
  2. Step 2: Test options

    A 11: floor(72/11)=6, floor(18/11)=1 -> 6-1+1=6 [check]
    B 9: floor(72/9)=8, floor(18/9)=2 -> 8-2+1=7 ✗
    C 13: floor(72/13)=5, floor(18/13)=1 -> 5-1+1=5 ✗
    D 10: floor(72/10)=7, floor(18/10)=1 -> 7-1+1=7 ✗
  3. Final Answer:

    11 -> Option B
  4. Quick Check:

    floor(72/11)-floor(18/11)+1=6 [OK]
Hint: Divide range by bins, round up to cover all data [OK]
Common Mistakes:
  • Choosing bin size equal to exact range divided by bins without rounding
  • Ignoring that bins must cover entire range
  • Assuming 10-year bins always create 6 bins regardless of range
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard