excel - 如何在范围上使用 LEFT() 函数
问题描述
我想返回以“Total”开头的单元格的引用。
示例行 (A1:A4):
Students
Lecturers
Tutors
Total
使用=MATCH("Total",A$1:A$10,0)
返回 4,但在实际数据中,A4 中的值将根据内容为“Total XZY”,因此我只需要比较单元格的前 5 个字符。
使用=MATCH("Total",LEFT(A$1:A$10,5),0)
返回#VALUE!
错误。当我进入函数编辑器窗口时,我可以看到公式正在被正确评估并得到 4,但它没有返回这个。图片附在下面。
为什么会发生这种情况,请问我怎样才能达到预期的结果?
解决方案
You are on the right track, the only thing you missed is that as this is an array and it will not work with a regular function. Try pressing Ctrl+Shift+Enter when you have created your MATCH function. It will look like this in the formula bar:{=MATCH("Total",LEFT($A$2:$A$6,5),0)} (Substitute your range with whatever range desired)
推荐阅读
- c++ - 如何制作硬编码堆栈,而不是硬编码并保持程序正常运行
- azure-active-directory - 检测没有 User.Read.All 权限的应用程序用户的删除
- python - 如何在 Python 中发送邮件
- oracle - 在项目上分配数量
- javascript - 如何从散点图中选择一个点并显示有关它的数据?
- mysql - 防止 INSERT INTO ... SELECT 语句创建自己的新快照
- angular - 简短的 TypeScript 导入语句语法在 Angular 中不起作用
- angular - cropper.replace 不替换图像
- windows - 使用 PowerShell 远程编辑注册表项的问题
- python - LSTM 的时间序列分类中的损失和准确率保持不变