Autofill.

Gnumeric's user manual
Prev |  | Next

# Chapter 4. Autofill.

# AutoFill

When dealing with spreadsheets it's pretty typical to want to add a set of cells that contain a series of numbers or dates or other values. While this can be done by hand, Gnumeric implements an autofill option to allow these sorts of series to be easily filled in.

A typical example of when you want to use this feature is to fill a series of numbers, maybe a list of part numbers, or a perhaps a list of TV channels. To create a list like this, all the user needs to do is to enter the first number into a cell, click on the autofill cursor in the bottom right corner of the cell border, and finally drag it in the direction to fill. If the first cell contains a '1', for example, dragging the autofill button(see Figure 4-1) down three or four cells will fill the cells with '1','2','3', and '4' automatically.(see Figure 4-2)

Autofilling a range of cells

1. Select the cell that marks the beginning of the area to autofill

2. Enter the starting value into this cell

3. Left click the small rectangle in the bottom right corner of the first cell, and drag it to the end of the area to fill.

4. Release the mouse button. The cells in the selected area should now be filled with autofilled values

Figure 4-1. A cell with the seed for an autofill.

Figure 4-2. A set of cells being autofilled

As handy as being able to simply and quickly generate series of numbers incremented by one is, autofill can do much much more. The next simplest example is autofilling with a series using an increment other than 1. For example, to create a series that consist of odd numbers starting at 11, just enter '11' into a cell and '13' into the next cell. Then select both cells, and stretch the selection in order to cover the cells to be filled. If you select the next 5 cells, for example, they will be filled with values '15','17','19','21', and '23.' See Figure 4-3 and Figure 4-4 for example.

Figure 4-3. A seed cell for a date autofill.

Figure 4-4. A set of cells being filled with a sequence.

## Filling with Dates

Oh, but numbers are easy you say! The real painful stuff is entering dates and times and other information. But never fear, Gnumeric is there to help you. Gnumeric has the ability to autofill dates, months, days of the week, and more.

As an example, think of a typical business invoice, where everything is logged by the month. So it is quite typical to want to fill a series of cells with the months of the year in order. To do this is quite simple, essentially the same steps as making a numerical fill.

Starting from cell B2, for example, to fill the next 12 cells with the months, just enter the string "January" in B2. Then, click the fill button and stretch it over the next 12 cells, and release. It is as simple as that. See Figure 4-5, Figure 4-6, and Figure 4-7.

Figure 4-5. A cell with a date in it, ready to be the seed for a fill.

Figure 4-6. A set of cells being filled.

Figure 4-7. A range of cells autofilled with the months.

Other examples of strings that can be autofilled include days of the week (Monday, Tuesday,...), short weekdays (Mon, Tues, ....), and short months (Jan, Feb,...)

More string fill types to follow

## String And Number autofill

Gnumeric tries to be intelligent about autofilling number values that embedded into text strings. So its possible to autofill cells with values like "9 lives to live","8 lives to live", etc.

See Figure 4-8 for some contrived examples.

Figure 4-8. Some simple autofill examples.

## Formula autofill

Probably the most useful of all the autofill capabilities is the ability to autofill functions. In practice it works essentially the same as all the other autofill methods; it just transfers the functions.

See Figure 4-9 and Figure 4-10 for a simple example.

Figure 4-9. Formula to be autofilled.

Figure 4-10. Formula autofilled to several cells.

## Automagic autofill

In the formula example above there were only a few rows to fill with the new formula. For larger spread sheets dragging out a new formula can be cumbersome. An alternative is to let gnumeric do the work for you.

1. Enter the formula in the top cell of the new column.

2. Double click on the small rectangle in the bottom right corner of the cell.

3. Gnumeric will look at the column to the left and find the first blank cell in that column. It will then fill the new column with your formula all the way down to the blank cell.

Double click together with the meta key will do automagic filling of rows instead of columns.

## Other Notes on autofill

- Autofills only work to the down and to the right of a cell.

- To make a series that decrements instead of incrementing, enter the highest value into the first cell, then the next value in the second cell and select them both like in the first step outlined above.

- Starting a series with more than two initial values can result in some unexpected results. Use with care.

Prev | Home | Next
Copying and Moving. |  | Cell Formatting