How to reference a fixed cell in Numbers?

I have been using spreadsheets since VisiCalc in 1980, and Numbers has me baffled, so I'm going to explain this problem very simply and carefully. The documentation is useless because it uses undefined terms. When I want to perform a calculation on a column of numbers, I refer to the cells in that column by preceding the column identifier with a dollar sign. For example, if in cell B2 I enter the formula "=$A2+3", then cell B2 will contain the value in cell A2 plus 3.


Now I select cell B2 and all the cells beneath it in column B and select the menu option Table > Autofill Cells > Autofill Down. This produces the result that cell B3 contains A3 + 3, cell B4 contains A4 + 3, and so forth. Old hat, right?


But now suppose that I want to expand the formula to include a constant value for all the cells in a column. Instead of cell B2 containing simply "$A2 + 3", suppose that I want to multiply the value in A2 by a constant stored in cell C22, and I want EVERY cell in column B to multiply its corresponding A-column value by the same constant in cell C22. For forty years, this was accomplished by entering the cell reference without the dollar sign. In other words, I would enter "($A2 x C22) + 3". Then I use the Table > Autofill Cells > Autofill Down and the cell in B3 contains the formula "($A3 x C22) + 3", and the cell in B4 contains the formula "($A4 x C22) + 3" and so on down the table.


All clear and simple -- but not for Numbers. I attach an image showing the sequence of events and the context:


Numbers inserted the value of cell A2 -- but I specified cell D2! I have tried many variations and figured out that what numbers calls "constants 0.50" is actually the title of the column and the contents of cell A2. If I enter "D3", Numbers inserts the contents of cell A3.


I can think of a variety of hypotheses to explain this odd behavior:

  1. Numbers always replaces column D with column A, because Apple programmers have a wicked sense of humor.
  2. My CPU has a hardware error.
  3. I have been cursed.
  4. I should fire up VisiCalc on my ancient Atari 800 and use it instead of Numbers


Can anybody suggest a more likely explanation for this phenomenon?


[Re-Titled by Moderator]

iMac 27″ 5K, macOS 12.5

Posted on May 27, 2023 10:22 AM

Reply
Question marked as Top-ranking reply

Posted on May 28, 2023 10:16 PM

ErasmusFrog wrote:


The core problem... is with my reference to cell D2. I want every single cell in column C (the column C shown in the last screenshot) to refer to cell D2. But instead, cell C2 refers to D2, C3 refers to D3, C4 refers to D4, and so on.


If you want a fixed reference to D2 then you would use $D$2. In Numbers you can do that by clicking the address "token" in the formula editor and checking both Preserve Row and Preserve Column, which will add both $ anchors for you.




SG

8 replies
Question marked as Top-ranking reply

May 28, 2023 10:16 PM in response to ErasmusFrog

ErasmusFrog wrote:


The core problem... is with my reference to cell D2. I want every single cell in column C (the column C shown in the last screenshot) to refer to cell D2. But instead, cell C2 refers to D2, C3 refers to D3, C4 refers to D4, and so on.


If you want a fixed reference to D2 then you would use $D$2. In Numbers you can do that by clicking the address "token" in the formula editor and checking both Preserve Row and Preserve Column, which will add both $ anchors for you.




SG

May 28, 2023 9:37 AM in response to ErasmusFrog

Nothing wrong with your computer! Your left column is defined as a Header Column (shaded by default), and Numbers is picking up the 0.50 from there.


If you are on the Mac then you will be able to see what is going on more clearly by going to Numbers > Settings and unchecking 'User header names as labels'. Then you will see A2 etc as you expect.


Tip: in Numbers you shouldn't have to do a lot of typing when you enter a formula, the way you did with VisiCalc. With the Formula Editor open, you can click a 'token' and select the cells or ranges to which you want to refer and Numbers will enter them for you.


If you haven't done so already you may find it helpful to spend a few minutes at Help > Numbers Help and also have a look at the templates at File > New in your menu.


SG

May 28, 2023 6:19 PM in response to SGIII

My explanation of the problem was screwed up. At first I did indeed refer to $A2, but then (as you can see from the screenshot of the table itself), I recognized the problem you describe and copied the contents of column A to column B, which I then used. Yes, I botched the explanation of the problem, wasting your time -- for which I apologize.


The core problem, which I think I managed to explain fairly well, is with my reference to cell D2. I want every single cell in column C (the column C shown in the last screenshot) to refer to cell D2. But instead, cell C2 refers to D2, C3 refers to D3, C4 refers to D4, and so on.


The central problem is this: I want to be able to write a formula that includes a value that is the same for each an every cell in a column. Now, the obvious way to handle this is to simply enter that value directly into the cell. In other words, if I want to include the value 1.11111 in every cell, then the cell formula might read like this:


= POWER($A2, 1.11111)


But I want to be able to change the value of the exponent (that is, 1.11111) frequently to see how it affects the final result. I don't want to have to change the value at the top of the column and then select the remainder of the column and select TABLE > AUTOFILL > AUTOFILL DOWN. I want to have that value (1.11111) in its own cell and then alter it and immediately see the effect of that change.


My understanding was always that prefixing a dollar sign to a column identifier would denote that reference would change for each row. Perhaps my moth-eaten memory is wrong, but I had thought that leaving out the $ prefix made the reference explicit to that particular cell. I was hoping that somebody would set me straight, perhaps by informing me that some other prefix is required to keep the referenced cell fixed in place. Perhaps ∉D2 nails it down, or maybe ∰D2. But apparently it is not possible to insert a fixed cell reference in a formula.


The hack that solved my problem was to give each constant its own column. Thus, the first constant is in column D, the second constant in column E, and so on. I enter the value of the first constant in D2, then enter the formula "=$D2+0" in cell D3, then autofill that formula all the way down the column. I do the same for the constant in column E.


This permits me to enter a formula such as:


= $D2 x POWER($B2, $E2)


and it works as I require. Here's the screenshot of the table that works:



Thanks again for your help. Sorry for the confusing description of the problem.

May 28, 2023 5:17 PM in response to ErasmusFrog

In what way did changing the setting not solve your problem that you were seeing something unexpected when you entered a formula in B2 and saw something you didn't expect when you pressed Return?


You seem to suggest there's something mysterious you are experiencing with Number and that something may be wrong with either Numbers or your computer? What is that something? Explaining it may help others here.


What is the "hack" that you are using?


SG



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to reference a fixed cell in Numbers?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.