简体   繁体   中英

Autofill every second cell in Excel

I'm looking to autofill cell values from every other cell. So I have one column that is my source column and one that I'm trying to autofill. So in my second column I want the first cell to be =A1, the second cell =A3, the third cell =A5 and so on. How can I easily do this?

Pulling in the 3 options from the comments above, there are 3 simple ways to do this. The first 2 options are volatile functions; this means they autocalculate every time any cell is changed in your workbook (instead of just when a relevant cell changes). Therefore they are a little bit more processing intensive, which only matters if you have a lot of them (let's say 10,000's). These formulas are:

=OFFSET(A$1,2*(ROW()-1),)

This starts at A1, moves down the number of rows the formula is in *2 - 1 (ie: if the formula is in cell 8, it moves down 15 cells). It takes the current column and gives a range 1x1 (ie: a single cell). Note that because Offset already starts at A1, you also need to subtract an extra row to account for how many spaces to move downward (done here as suggested by @pnuts by multiplying the -1 by 2).

Alternatively, INDIRECT works by creating a reference to a specific range (in this case a single cell), and then gives the value for that cell - like so:

=INDIRECT("A"&2*Row()-1)

To do this without a volatile formula, you can use INDEX. INDEX takes a specific array (in this case column A), and returns the value from the xth item of that column (in this case the row 2* the current row - 1). This would be as follows:

=INDEX(A:A,ROW()*2-1) 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM