Skip to content
Fix Code Error

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

March 13, 2021 by Code Error
Posted By: Anonymous

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)

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.?

Solution

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
Answered By: Anonymous

Related Articles

  • Using Auto Layout in UITableView for dynamic cell layouts &…
  • assign flexbox cells the same width
  • How do SO_REUSEADDR and SO_REUSEPORT differ?
  • Homebrew install specific version of formula?
  • How do I limit the number of digits from 6 to 4 in JS?…
  • Freezing Row 1 and Column A at the same time
  • Polymer 1.0 Trying to make a splitter which works like…
  • Remix error The transaction has been reverted to the initial…
  • Adding Dynamic Input Fields With VueJs
  • How do I include certain conditions in SQL Count

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

Post navigation

Previous Post:

How to Right-align flex item?

Next Post:

What is the “–>” operator in C/C++?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Get code errors & solutions at akashmittal.com
© 2022 Fix Code Error