Apply Formula to a Range of Cells without Drag and Drop

27

8

Typically, in Excel, one can autofill a column by drag a cell down. However, since a lot of a lot of cells to fill up, manually dragging and scrolling the spreadsheet is time consuming.

Is there a much better way to fill up a column with formulas?

Edit: I tried to input the $F$1:$F$20000 at the highlighted place, but the values inside column F is not populated.

alt text

Graviton

Posted 2010-08-25T02:47:21.040

Reputation: 5 006

Answers

33

Instead of clicking and dragging the square in the lower right corner of the cell, you should try instead to double click it. This will autofill it down.

Also, you should get used to using "ctrl" and "shift". When I use excel I go extremely fast because I use lots of keyboard shortcuts. Let me walk you through an example and let you know exactly what I would type. Lets say you have data in Columns A:E with 20000 rows, and want to create a formula for F. Follow these steps:

  • First put your formula in F1.
  • Now hit ctrl+C to copy your formula.
  • Hit left, so E1 is selected.
  • Now hit Ctrl+Down. This will travel all the way down until a blank is hit, in this example its E20000.
  • Now hit right so F20000 is selected.
  • Now hit ctrl+shift+up. Now you will be selecting F1:F20000.
  • Finally either hit ctrl+V or just hit enter to fill the cells.

Once you get used to doing things like this, these 6 keystrokes happen very fast in a fraction of a second.

Jarvin

Posted 2010-08-25T02:47:21.040

Reputation: 6 712

i use the 6-keystroke way all the time :) – wilson – 2010-08-25T04:27:39.973

Can't you just do ctrl+c, ctrl-shift-down, ctrl-v? – Worse_Username – 2017-10-18T08:53:46.057

@Worse_Username Try it -- you'll end up at the very last row, not the bottom of the data. You can do it, but your filesize will shoot up. – Fund Monica's Lawsuit – 2018-02-02T18:10:24.247

Beautiful, learned how the fast people do it like..!! – Irfan – 2019-10-23T09:16:27.463

17

Actually there is a better way

  • Copy your formula Ctrl + C
  • press
  • Ctrl + Shift + selects to the last nonblank cell
  • paste Ctrl + V

4 strokes. Discovered it just now

user1212326

Posted 2010-08-25T02:47:21.040

Reputation: 371

As a note for others who find this, you can also do the same thing across rows (such as for headers), and do ctrl+shift+right – Shawn – 2017-10-31T19:45:52.460

you can skip step #2. You can paste a formula into the cell from which it came without any negative consequences. but double-click is quicker most of the time. – mpag – 2018-04-02T22:52:11.033

For some reason @Shawn's suggestion didn't work for me for one instance of Excel. Restarting Excel fixed that. But I also "discovered" that highlighting the left column of the range, then pressing the End key, then doing Shift+right arrow, then either pasting in the formula or doing a Control+R copies the formulas from the left column rightward. – mpag – 2018-04-03T17:11:31.647

@mpag Actually, if you skip step 2 and the formula has been array-entered, you get a "You cannot change part of an array." error. – robinCTS – 2018-06-11T08:51:01.957

2

  • Copy the cell that contains the original formula to the clipboard.
  • Click into the "cell name" box (in the upper left) and enter the range that you want to select, followed by Enter.
  • Paste to the selection.

Does that work?

JanC

Posted 2010-08-25T02:47:21.040

Reputation: 1 125

no, it doesn't work. See my updated question. – Graviton – 2010-08-25T03:59:35.893

Weird, it works in OpenOffice.org, and at least one Excel tutorial I found mentioned it too (but it looked like Excel 2000 or such, so maybe Microsoft removed this feature...). – JanC – 2010-08-25T15:37:41.247

BTW: you should probably type F1:F20000 without the "$" signs. – JanC – 2010-08-25T15:42:11.960

1

When selecting a whole column you can just enter F:F

This is particularly useful when adding or doing some operation with a whole range and where you may want to add data to the range.

Ruben Misrahi

Posted 2010-08-25T02:47:21.040

Reputation: 63

note that you can do this in formulae as well (e.g. SUM(F:F)), as long as your destination cell is not within F. – mpag – 2018-04-02T22:50:14.623

0

Select the range where you want the formula, create the formula and hit Ctrl + Enter
it will fill all the selected range with relative reference also

user555689

Posted 2010-08-25T02:47:21.040

Reputation:

0

I had to do this just the other day.

  • Copy the formula with relative referencing, i.e. no $ signs.
  • Select the range you want to fill.
    I was grabbing the bottom cell, then pressing End-Shift-UpArrow.
  • Paste the formula in the selection.
    Excel will change the relative referencing for each cell.

Lance Roberts

Posted 2010-08-25T02:47:21.040

Reputation: 7 895

0

  1. ctrl + C to copy the formula you wanted
  2. for 2003 excel click edit-> go to
  3. in go to window put your ranges in; such as A2:A238
  4. then ctrl + V to paste formula to exact cell range you selected.

This way you don't have #DIV/0! in other cells; sometimes #DIV/0! affect other calculations;

If you use count function you will know how many rows of data you have.

Alice

Posted 2010-08-25T02:47:21.040

Reputation: 1