开发者

Excel 2007 get value of cell for formula not reference

开发者 https://www.devze.com 2023-04-01 14:16 出处:网络
I have a sheet of numerical data. I want to multiply values by scaling factors which are in other cells that I can change. What I would ideally like to do is a substitution like such (just an example)

I have a sheet of numerical data. I want to multiply values by scaling factors which are in other cells that I can change. What I would ideally like to do is a substitution like such (just an example):

22.85 becomes =(F$15*22.85)

I could do this easily in a script but I'd rather just stay in Excel.

What I'm thinking would be easiest is to make a formula like =(F$15*...) and drag it out, but in place of '...' I want it to just get the value of the cell, not a reference to it.

This is because I want to replace the cells, so a formula like =(F$15*L4) would be in cell L4 and referencing itself, which obvi开发者_如何学Cously wouldn't work.

Thanks :)


If you are multiplying all the numbers in a range of by the same number, say 22.85, you may follow this Paste Special procedure.

Let's suppose that a1:a5 are:

10
1
100
3
5

Then you place 22.85 in b1.

Select the 22.85 in b1 and press Ctrl-C. Then choose the range a1:a5. From the Home tab, choose Paste -> Paste Special... (Or, you may right click on any cell in the range and choose Paste Special...)

In the Operation area of the Paste Special popup, choose Multiply. All the numbers will be multiplied by the copied number, 22.85. a1:a5 were multiplied in place and became:

228.5
22.85
2285
68.55
114.25


You could create a second column, and then hide the original column (right click column > hide column)

0

精彩评论

暂无评论...
验证码 换一张
取 消