Jump to: navigation, search
  • Main page
  • Recent changes
  • Random page
  • Date Slicer

    Date Slicers can be based on an Excel range, or direct from SQL. This example shows you how to use it from Excel, but a SQL statement which returns the same result set format can also be used.

    The first thing to do is to set up two Excel cells to hold the date range. We have a start date and an end date in cell locations B1 and B2 as below:

    Ds1b.png

    Next you insert an Excel slicer from the Slicer tab

    Ds2a.png

    You will see Insert Slicer Window displayed.

    Set the Slicer Range to point to the Start Date and End Date (cells B1:B2 in this example)

    Select the Date Slicer type

    Check the box to Update Range With Selection and enter a cell location. This will be where the date selected will be held. The date selected is displayed as the serial number equivalent so that the user can then choose to format the date as they need.

    Ds3.png

    Click OK to exit.

    Click the drop-down on the slicer and XLCubed will display a calendar control which can be navigated between the specified start and end dates.

    Ds4a.png

    Click a date to select it and it will be written as the Excel serial number equivalent to the cell location defined in Update Range With Selection.

    You can then choose to format this by using the Excel TEXT function eg =TEXT(E1,"dd-mm-yyyy").

    You can also include a third cell in your Slicer Range as Selection Type eg Day, Month or Year. Valid selections are D, M or Y. Day is taken to be the default selection type and is the default display mode if no selection type if specified.

    So let's change the slicer range to also include B3 (which holds our selection type) and click OK.

    Ds8.png

    Set B3 to M and now when you click the drop-down box you will be be able to pick only months between the range specified.

    Ds5.png

    Similarly change the type to D for day and Y for Y:

    Ds6.png Ds7.png


    See Also