1

I'm trying to do a formula where it is CELL / 127.05 - 1 and apply this to columns H-Y and rows 2-455. I'm not really familiar with excel and am going about this calculation cell by cell. Also, I'm running into a "circular" problem where certain cells rely on another, if anyone could explain this.

Thanks ahead of time!

Dmitry Pavliv
  • 35,333
  • 13
  • 79
  • 80
  • One way is to highlight the column (or specific range) you want to apply the formula to, press F2 to access the formula bar, type the formula, and press CTRL+D to paste DOWN if the range is vertical and CTRL+R to paste ACROSS if the range is horizontal. – 114 May 27 '14 at 15:01
  • How do you apply it to all cells in the range? Right now I'm having to do like R4/ 127.05 - 1 for example.Is there a way to put "CELL" ? – user3680304 May 27 '14 at 15:03
  • 1
    **Do all the cells contain data or do some of the cells contain formulas?** – Gary's Student May 27 '14 at 15:08
  • 1
    It sounds like you want to apply that formula to same cell that contains the value you want to act on. That will not work. results cells (i.e. containing your conclusions) will contain the formula and a reference to the cell it will act on. eg. if the value 1 is contained in a1, then in cell b1 you could enter `= a1/127.05 -1`. the value -0.992129... would appear. – ryyker May 27 '14 at 15:09
  • All the cells I am trying to apply the formula to contain data, no formulas. I just don't want to go through 455 cells for each column and reapply this formula – user3680304 May 27 '14 at 15:10
  • @User3680304 Ahh I see what you mean now. This won't be possible without some code. As mentioned by ryyker you would need to apply the formula to the cells you want to change in a DIFFERENT range, and then paste that new range back into the original range. – 114 May 27 '14 at 15:11
  • When working with Excel it's almost always always better to do it in a non-destructive manner, this means if you make an error in the calculation it can be fixed. I would use a new sheet with the formulas in and keep the data intact on the original. – bendataclear May 27 '14 at 15:33

3 Answers3

2

A formula in a cell generally cannot refer to itself. If you want to apply an operation to an existing range of data, you can, but it is quite rare and surely not in the spirit of a spreadsheet app.

Regarding your question, you could
- enter a value (127.05) anywhere in an empty cell,
- then copy that cell
- then select the range you want to modify
- then select Paste Special / Divide (or any other operation)

iDevlop
  • 24,841
  • 11
  • 90
  • 149
  • @pnuts - in the spirit of being real, this is, as you said, a much better answer. +1. – ryyker Jun 18 '14 at 23:48
  • 1
    @pnuts - As I eluded to (in deleted portion of comment), I am an amateur with Excel. I rely on brute force, a lot of head scratching and SO posts in my spreadsheets. I did not know one could do what iDevelop so succinctly laid out. (therefore +1) Nevertheless, it is fun to solve problems, even if not always with elegance. – ryyker Jun 19 '14 at 14:05
0

One way is to highlight the column (or specific range) you want to apply the formula to, press F2 to access the formula bar, type the formula, and press CTRL+D to paste DOWN if the range is vertical and CTRL+R to paste ACROSS if the range is horizontal. Say that your data looks like this:

    A        B
   ---      ---
    5     A1/127-1
    4
    7
    8

Then in order to copy the formula down, highlight A2 to A4 and press CTRL+D, or highlight B1, and click on the bottom right of the box that comes up surrounding the cell.

If you wanted to simply replace the values in A with their formula values you would still have to use Column B as a 'helper' column, rather than entering the value right into the cell. This is in fact exactly what is giving you the circular reference error.

Regarding the circular error, you may be trying to apply the formula to the cell you are already in. For example, if you are trying to apply the formula A1 / 127 - 1 in the cell A1 Excel won't know what to do because you have specified that the value of A1 is both the value in the specified cell and another value ( A1 / 127 - 1), which can't be true.

Now, the only way I know of to do what you're requesting is with VBA, because I realized just now that I asked a very similar question a while ago which was helpfully answered by Gary. The code was as follows:

Sub Formulate()
    Dim N As Long, i As Long, dq As String
    N = Cells(Rows.Count, "A").End(xlUp).Row
    dq = Chr(34)
    For i = 1 To N
        v = Cells(i, 1).Value
        Cells(i, 1).Formula = "=Text(" & v & "," & dq & "mm/dd/yyyy" & dq & ")"
    Next i
End Sub
Community
  • 1
  • 1
114
  • 876
  • 3
  • 25
  • 51
  • Is there a way to do this? All I am trying to do is manipulate all the data that I already have. Or will I have to calculate it in another cell and then paste it back into that row? Is there a way to automate this? Also instead of having to type in A1 - A455 is there a way to just apply it to all of column A? – user3680304 May 27 '14 at 15:07
0

As I said above, it sounds like you want to apply that formula to same cell that contains the value you want to act on. That will not work. results cells (i.e. containing your conclusions) will contain the formula and a reference to the cell it will act on. (Although I am using a smaller area for illustration, the principles will apply to your specific application)

Note - I used the randbetween(min,max) function to populate all the data cells. this is why each image contains different data. You of course will use cells containing static data.

For a simple example:

Say you put the value 127.05 in cell A1, and have a range of data cells, like this: enter image description here

In cell F1, enter = b1/$a$1 - 1 like this: enter image description here

Note, the $ signs tell Excel to use a static location cell reference. After hitting enter, the value -0.85045 will appear. Now, click and hold your mouse starting in that cell, and drag your mouse down to row 14 release the mouse button and hit keys <ctrl><d>. Your sheet should look like this:

enter image description here

Hold down the shift key while the column is still selected, and hit the right arrow key 3 times, Your sheet should look like this:
enter image description here release the shift key and while the cells are all highlighted, hit keys <ctrl><r>. The results are here:
enter image description here

ryyker
  • 22,849
  • 3
  • 43
  • 87
  • Thank you! However when I do that the value that appears in the cell is #VALUE! What does this mean? – user3680304 May 27 '14 at 15:41
  • #VALUE! means you have entered something into the cell that Excel cannot resolve, or does not make sense (to Excel). Check that you entered an = sign, then the division statement then the subtraction statement, exactly like this: ***=b1/$a$1 - 1*** in cell F1. do not forget the equal sign. this tells Excel you are entering some kind of formula, or calculation. – ryyker May 27 '14 at 15:57
  • You are welcome. ***[HERE](http://www.excel-easy.com/)*** is a tutorial that may come in handy for learning some basic Excel usage. – ryyker May 27 '14 at 17:26