开发者

Formula in all cells in a column

开发者 https://www.devze.com 2022-12-25 23:42 出处:网络
Simple question: I want to create a formula which, in column Cn, will compute the values of An * Bn. example

Simple question:

I want to create a formula which, in column Cn, will compute the values of An * Bn.

example

column C1 = column A1 * column B1
column C2 = column A2 * column B2
column C3 = column A3 * column B3

...etc

all the way down to

col开发者_运维问答umn Cn = column An * column Bn

Thanks


Easy way to do it.

  1. Highlight your formula cell.
  2. The lower right corner should turn into a + sign.
  3. Click on that + sign and drag it for as many rows as you like.

Alternatively, you can do this:

  1. Highlight the formula cell.
  2. Ctrl+C to copy.
  3. Click on the C column.
  4. Hit enter.

Now with the second method, it may start to lock up on you because of the large number of cells it has to compute. Just hit escape and it'll go back to normal (but some cells may not be filled in, depending on how early you hit escape.)


In what context are you trying to create a formula? If in VBA, you can do something like:

Range("A1").FormulaR1C1 = "=RC[-2]*RC[-1]"

This formula is in R1C1 format. It tells the system to take the value two columns to the left of the cell containing the formula and multiply it by the column to immediately to the left of the cell containing the formula. This same formula could be entered in all rows of column C and would automatically adjust based on the row.

0

精彩评论

暂无评论...
验证码 换一张
取 消