简体   繁体   English

基于 Excel 单元格值引用 Excel 列

[英]Reference an Excel Column based on an Excel cell value

In Excel how can I create a cell function which does the following...在 Excel 如何创建一个单元格 function 执行以下操作...

  1. If cell C1 contains the value 6, I want cell B1 to be the contents of cell M1,如果单元格 C1 包含值 6,我希望单元格 B1 是单元格 M1 的内容,
  2. If cell C1 contains the value 7, I want cell B1 to be the contents of cell N1如果单元格 C1 包含值 7,我希望单元格 B1 是单元格 N1 的内容

and so forth, increasing by one column (M,N,O...) at a time.依此类推,一次增加一列 (M,N,O...)。

I've tried with the functions INDEX, IF, MATCH and, LOOKUP.我已经尝试过使用函数 INDEX、IF、MATCH 和 LOOKUP。

Use INDEX and simple math:使用INDEX和简单的数学:

=INDEX(1:1,C1+7)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM