gpt4 book ai didi

excel - Excel公式中有变量之类的东西吗?

转载 作者:行者123 更新时间:2023-12-01 16:33:28 24 4
gpt4 key购买 nike

我讨厌重复函数,尤其是在 Excel 公式中。有什么办法可以避免类似的事情:

=IF( VLOOKUP(A1, B:B, 1, 0) > 10, VLOOKUP(A1, B:B, 1, 0) - 10, VLOOKUP(A1, B:B, 1, 0) )

[以上只是问题的一个简单示例,而不是我正在使用的特定公式。]

最佳答案

您可以为公式的 VLOOKUP 部分定义一个名称。

  1. 突出显示包含此公式的单元格
  2. 在“插入”菜单上,转到“名称”,然后单击“定义”
  3. 输入变量的名称(例如“值”)
  4. 在“引用”框中,输入 VLOOKUP 公式:=VLOOKUP(A1,B:B, 1, 0)
  5. 单击“添加”,然后关闭对话框
  6. 在原始公式中,将 VLOOKUP 部分替换为您刚刚定义的名称:=IF( Value > 10, Value - 10, Value )

步骤 (1) 在这里很重要:我猜在第二行,您希望 Excel 使用 VLOOKUP(A2,B:B, 1, 0) ,第三排VLOOKUP(A3,B:B, 1, 0)步骤(4)通过使用相对引用( A1B:B )而不是绝对引用( $A$1$B:$B )来实现这一点。

Note:

  1. For newer Excel versions with the ribbon, go to Formulas ribbon -> Define Name. It's the same after that. Also, to use your name, you can do "Use in Formula", right under Define Name, while editing the formula, or else start typing it, and Excel will suggest the name (credits: Michael Rusch)

  2. Shortened steps: 1. Right click a cell and click Define name... 2. Enter a name and the formula which you want to associate with that name/local variable 3. Use variable (credits: Jens Bodal)

关于excel - Excel公式中有变量之类的东西吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/771973/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com