How to keep one variable constant with other one changing with row in excel

后端 未结 8 1447
心在旅途
心在旅途 2020-12-22 17:03

Lets say I have one cell A1, which I want to keep constant in a calculation. For example, I want to calculate a value like this:

=(B1+4)/(A1)
相关标签:
8条回答
  • 2020-12-22 17:35

    Use this form:

    =(B0+4)/$A$0
    

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

    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
    • Mac: CommandT
    0 讨论(0)
  • 2020-12-22 17:40

    For future visitors - use this for range: ($A$1:$A$10)

    Example
    =COUNTIF($G$6:$G$9;J6)>0
    
    0 讨论(0)
  • 2020-12-22 17:45

    To make your formula more readable, you could assign a Name to cell A0, and then use that name in the formula.

    The easiest way to define a Name is to highlight the cell or range, then click on the Name box in the formula bar.

    Then, if you named A0 "Rate" you can use that name like this:

    =(B0+4)/(Rate)
    

    See, much easier to read.

    If you want to find Rate, click F5 and it appears in the GoTo list.

    0 讨论(0)
  • 2020-12-22 17:48

    There are two kinds of cell reference, and it's really valuable to understand them well.

    One is relative reference, which is what you get when you just type the cell: A5. This reference will be adjusted when you paste or fill the formula into other cells.

    The other is absolute reference, and you get this by adding dollar signs to the cell reference: $A$5. This cell reference will not change when pasted or filled.

    A cool but rarely used feature is that row and column within a single cell reference may be independent: $A5 and A$5. This comes in handy for producing things like multiplication tables from a single formula.

    0 讨论(0)
  • 2020-12-22 17:54
    =(B0+4)/($A$0)
    

    $ means keep same (press a few times F4 after typing A4 to flip through combos quick!)

    0 讨论(0)
  • 2020-12-22 17:56

    Yeah. Just put the $ sign in front of your desired constant cell.

    Like $A6 if you wish to just change the number 6 serially and keep a constant, or $A$6 if you do not want anything from that reference to change at all.

    Example: Cell A5 contains my exchange rate. In B1 you put say ( = C1 * $A$1). when you fill B1 through B....... the value in A5 remains constant and the value in C1 increases serially.

    I am by far not be good at teacher, but I hope this helps!!!! Wink wink

    0 讨论(0)
自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题