Pack function allows you to remove blank rows and/or columns from the dataset.


Pack Mode Property allows you to define whether empty rows (option Records), empty columns (option Variables), or empty rows and columns (option Both) are deleted.


Remove Empty Rows, Remove Empty Columns, Remove, Messy datasets, Clean Empty, Missing Cells, Pack, Blank Rows, Blank Columns

See Also

Drop_NA, Select_NA, Fill_NA, Filter


How to Remove Empty Rows and Columns from Excel Table

Sometimes it may happen that the dataset contains a number of empty rows or columns. You can use the Pack function to delete them quickly. If you want to delete rows containing several empty cells, see the Drop_NA function. The Pack function is for rows or columns that are completely empty. The example is shown in the following illustration.

Empty rows and columns are marked by pink background. If you want to delete them, click on the button Pack in the ribbon toolbar tab Reshape.

When you click the button, the function is added to the side panel. Clicking on it will show one customizable parameter in the Properties Panel - Pack Mode. Use it to define whether you want to remove empty rows (option Records), empty columns (option Variables), or blank rows and columns at once (option Both).

The following figure shows and example of removed blank rows. If the line contains at least one value, it will remain in the table.

The next image shows an example of removed empty columns. In this case, variables H and N were removed from the table.

Finally, the last example shows a combination of the previous two options - deleting both blank rows and columns.

The Pack function is simple to use and fast. In the case, you want to remove rows containing some empty cells, use the Drop_NA function.