Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
490 views
in Technique[技术] by (71.8m points)

excel - 如何使一个变量保持不变,其他变量与excel中的行一起变化(How to keep one variable constant with other one changing with row in excel)

Lets say I have one cell A1, which I want to keep constant in a calculation.

(假设我有一个单元格A1,我想在计算中保持不变。)

For example, I want to calculate a value like this:

(例如,我想计算这样的值:)

=(B1+4)/(A1)

How do I make it so that if I drag that cell to make a calculation across cells in many rows, only the B1 value changes, while A1 always references that cell, instead of going to A2, A3, etc.?

(如何将其设置为如果我拖动该单元格以在多行中的单元格之间进行计算,则只有B1值会更改,而A1始终引用该单元格,而不是转到A2,A3等?)

  ask by dude translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Use this form:

(使用此表格:)

=(B0+4)/$A$0

The $ tells excel not to adjust that address while pasting the formula into new cells.

($告诉excel在将公式粘贴到新单元格时不调整该地址。)

Since you are dragging across rows, you really only need to freeze the row part:

(由于您要跨行拖动,因此您只需要冻结行部分:)

=(B0+4)/A$0

Keyboard Shortcuts (键盘快捷键)

Commenters helpfully pointed out that you can toggle relative addressing for a formula in the currently selected cells with these keyboard shortcuts:

(评论者有用地指出,您可以使用这些键盘快捷键切换当前所选单元格中公式的相对寻址:)

  • Windows: f4

    (Windows: f4)

  • Mac: Command T

    (Mac: 命令 T.)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...