Excel 与输入和输出相同的单元格
我有一个 Excel 工作表,其中有多个列,其中的十进制值在小数点后有两位数,例如 15.98、14.42。
我编写了一个公式,将小数点后的值更改为 0.45 或 0.95,公式如下
=IF(AND(MOD(M8,1)>=0,MOD(M8,1)<=0.49),0.45,0.95)+FLOOR(M8,1)
- 我可以将此公式应用于单元格并在不同的单元格中显示输出,但我希望公式位于与输入和输出(这似乎不可能)。
- 当我将公式应用于行的第一列时,单击单元格句柄后,它将应用于下面的所有行(垂直),但是我如何才能将此公式立即应用于所有行和列?
I have an Excel sheet that has multiple columns with decimal values having two digits after the decimal e.g. 15.98, 14.42.
I wrote a formula that changes the value after the decimal point to 0.45 or 0.95, Formula is as follows
=IF(AND(MOD(M8,1)>=0,MOD(M8,1)<=0.49),0.45,0.95)+FLOOR(M8,1)
- I can apply this formula to a cell and display the output in a different cell, but I want the formula to be in the same cell as the input and output (which doesn't seem possible).
- As I apply the formula to the first column of a row, after clicking the cell handle it is applied to all the rows below (vertically), but how would I go about getting this formula to apply to all rows and columns at once?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须使用 VBA 将输入转换为同一单元格中的输出。
您可以复制公式,然后选择整个工作表(通过单击左上角的框),然后粘贴,但这仅适用于没有引用的公式(例如
=1+1
) ,任何带有引用的东西都会导致你有一个自引用单元格。如果您选择引用单元格范围之外的行和列,这是一个非常好的方法。You would have to use VBA to get your input to transform to your output in the same cell.
You can copy the formula, then select the whole sheet (by clicking the upper-left hand corner box), then pasting, BUT this will only really work for formulas without references (like
=1+1
), anything with a reference will cause you to have a self-referencing cell. It's a very good method if you select rows and columns that are outside of the referenced cells range.