在电子表格中给定行中两列相减的方法。

huangapple go评论117阅读模式
英文:

How to substract a number in two columns in the given row in spreadsheets

问题

It seems you want to translate the Excel formula and the explanation you provided. Here's the translated content:

如果D中的值为“Long”,我想执行“I - J”,如果D中的值为“Short”,我想执行“J - I”。我想对当前行执行此操作。

但是,我遇到了以下错误:
“VALUE参数' $I$2'无法解析为数字。”

提供了我的电子表格截图:
[![点击这里查看图片描述][1]][1]

Please note that I've translated the text you provided without addressing the issue mentioned in your question. If you need further assistance with the Excel formula error, please let me know.

英文:
=IF(ADDRESS(ROW(),4)="Long",VALUE(ADDRESS(ROW(),8))-VALUE(ADDRESS(ROW(),9)),VALUE(ADDRESS(ROW(),9))-VALUE(ADDRESS(ROW(),8)))

I want to perform I - J if the value in D is Long, I want to perform J - I if the value in D is Short. I want to do this for the current row

However, I get the following error:
VALUE parameter '$I$2' cannot be parsed to number.

Provided is a screenshot of my spreadsheet
在电子表格中给定行中两列相减的方法。

I would appreciate help, since this is my first time working with spreadsheet formulas.

答案1

得分: 4

"ADDRESS" 指的是地址(这里是 $I$2 ),而不是值(这里是 1.2 )。如果您想继续使用这种 ADDRESS 方法,那么尝试使用 INDIRECT

=IF(indirect(ADDRESS(ROW(),4))="Long",VALUE(indirect(ADDRESS(ROW(),8)))-VALUE(indirect(ADDRESS(ROW(),9))),VALUE(indirect(ADDRESS(ROW(),9)))-VALUE(indirect(ADDRESS(ROW(),8))))

英文:

ADDRESS refers to the Address, (here $I$2) not the value (here 1.2). If you want to keep this ADDRESS method, then try to use INDIRECT

=IF(indirect(ADDRESS(ROW(),4))="Long",VALUE(indirect(ADDRESS(ROW(),8)))-VALUE(indirect(ADDRESS(ROW(),9))),VALUE(indirect(ADDRESS(ROW(),9)))-VALUE(indirect(ADDRESS(ROW(),8))))

huangapple
  • 本文由 发表于 2023年5月11日 16:14:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76225467.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定