将 Excel 中的单元格链接为特定格式

发布于 2024-11-27 02:56:05 字数 173 浏览 0 评论 0原文

我正在尝试链接两个不同工作表上的 Excel 单元格。 我使用的公式例如:cell1 = cell2 + cell3。我在 cell2 和 cell3 中的数字的格式为 100% (1) 和 50% (2)。我只想将数字 1 和 2 相加,这样我的 cell1 就会有数字 3。 是否可以在不改变单元格格式的情况下完成? 多谢。

I am trying to link cells in excel on two different work sheets.
I am using the formula eg: cell1 = cell2 + cell3. The numbers that I have in cell2 and cell3 are in format of 100% (1) and 50% (2). I just want to add numbers 1 and 2 so that my cell1 will have number 3.
Is it possible to do without changing the cell formats?
Thanks a lot.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

决绝 2024-12-04 02:56:05

如果您不关心百分比,只需复制包含百分比的列并将该列的格式更改为值,然后在工作表 2 中对该列进行加法即可。

不幸的是,当单元格具有百分比格式并且用户输入数字时,它会被转换为给定格式上下文的含义。所显示的内容与单元格内“隐藏”的内容并没有很大不同。当您重新格式化单元格时,该数据也会重新格式化,因此 50% 会变成 0.5,即使您在更改格式之前最初在单元格中输入了 50。格式不仅仅是“显示格式”,所以也许这就是混乱的地方。

如果您想在百分比行中添加单元格而不费心重新格式化公式单元格,您可以作弊并将其视为字符串以摆脱该百分比。您可以执行 =Left(A2+A3, Len(A2+A3)) 这将为您提供 1.5 答案,而无需格式化单元格。

If you don't care about the percentages, just copy your column with the percentages and change the format of that column to value and in sheet 2, do addition on that column instead.

Unfortunately when a cell has a format of percentage and a user enters a number, it is converted into what it means given the context of the format. It's not like what is being displayed is wildly different than what is 'hidden' inside the cell. When you reformat a cell, that data is reformatted as well, so 50% becomes .5 even if you had originally entered 50 in the cell before changing it's format. Format is more than just 'display format' so maybe that's where the confusion is.

If you want to add the cells in the percentage row and not bother with reformatting the formula cell you can cheat and treat it as a string to get rid of that %. You could do =Left(A2+A3, Len(A2+A3)) that will give you the 1.5 answer without having to format te cell.

满天都是小星星 2024-12-04 02:56:05

不确定我是否理解你的问题,但我会给出一些元素:

  • 公式和格式在 Excel 中是分开的,因此,你可以在 A1 中设置公式,例如 =A2+A3 但会按照您希望的方式显示
  • 例如,如果 A2 包含 100%A3 包含 50%,那么A1 中的结果是 值得 1.5
  • 您可以按照您希望的方式设置 A1 的格式(右键单击> 设置单元格格式 > 数字选项卡),例如小数,则单元格将显示 1.5,但如果您选择百分比,然后单元格将显示 150%

如果需要,请详细说明您的问题。

[编辑]感谢您的评论的新答案:
如果我理解得很好,您想要总结单元格中括号之间的值(无论之前是什么,您的情况下的事件百分比)。
然后,您可以在单元格 A3 中尝试此操作:

=MID(A1,FIND("(",A1)+1,FIND(")",A1)-FIND("(",A1)-1 )+MID(A2,FIND("(",A2)+1,FIND(")",A2)-FIND("(",A2)-1 )

Not sure i understood your question but i'll give some elements:

  • formula and formats are separated in Excel, thus, you can set a formula in A1, say =A2+A3 but displays the value the way you wish
  • for instance, if A2 contains 100% and A3 contains 50%, then the result in A1 is worth 1.5
  • you can set the format of A1 the way you wish (Right-clic > Format cells > Number tab), for instance, decimal, the cell will then display 1.5 but if you choose percentage, the cell will then display 150%

Please elaborate your question if needed.

[EDIT] New answer thanks to your comment:
If i understand well, you want to sum up the values between brackets in your cell (whatever is before, event percentages in your case).
Then, you can try this in cell A3:

=MID(A1,FIND("(",A1)+1,FIND(")",A1)-FIND("(",A1)-1 )+MID(A2,FIND("(",A2)+1,FIND(")",A2)-FIND("(",A2)-1 )
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文