英文:
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))))
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论