Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在计算我们的地铁和乡村客户每次旅行的大致费用。
我需要知道如何获取单元格 H4:H42 以从单元格 D43 中获取数据,如果值为 1,则显示“地铁驾驶”;如果值为 2,则从 D45 中获取“乡村驾驶”的数据。
希望这是有道理的。
提前致谢。
你在看下面吗?(把这个公式放在 D4 单元格中)
假设 D43 =“地铁驾驶”,D45 =“乡村驾驶”,您可以使用以下内容:
=IF(H4=1,$D$43,IF(H4=2,$D$45,"Nothing Matched"))
您可以尝试简单的查找和替换或以下公式:
=CHOOSE($H4,$D$43,$D$45)
这将获取 H 中的值并将 D43 分配给 1,将 D45 分配给 2,如果要为 3+ 添加更多值,依此类推。