简体   繁体   English

IF公式-EXCEL-从另一个单元格获取数据

[英]IF formula - EXCEL - obtain data from another cell

I am calculating the approximate cost per journey of our metro and country customers. 我正在计算我们的地铁和乡村客户每次旅行的大概费用。

I need to know how to get cells H4:H42 to obtain the data from cell D43 which says "Metro driving" if the value is 1 OR the data from D45 which says "Country driving" if the value is 2. 我需要知道如何获取单元格H4:H42,以从单元格D43中获取数据(如果该值为1,则表示“ Metro驾驶”),或者从D45中获得数据,如果其值为2,则表示“国家驾驶”。

Hope this makes sense. 希望这是有道理的。

Thanks in advance. 提前致谢。

Are u lookin below one ?(place this formula in D4 cell) 您在下面查找吗?(将此公式放在D4单元格中)

Assuming that D43 = "Metro driving", and D45 = "Country driving", you could use the following: 假设D43 =“地铁行驶”,而D45 =“乡村驾驶”,则可以使用以下命令:

=IF(H4=1,$D$43,IF(H4=2,$D$45,"Nothing Matched"))

You could try a simple find and replace or the following formula: 您可以尝试简单的查找和替换或以下公式:

=CHOOSE($H4,$D$43,$D$45)

This gets the value in H and assigns D43 for 1, D45 for 2, and so on if you were to add more values for 3+. 这将获得H中的值,并为D43分配1,为D45分配2,依此类推,如果要为3+添加更多的值。

暂无
暂无

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

相关问题 Excel:求和公式,从一个单元格中的值到另一个单元格中的值 - Excel: Summation formula, from a value in a cell, to a value in another cell EXCEL公式或VBA基于另一个单元格的数据提取数据 - EXCEL Formula or VBA To Extract Data Based on Another Cell's Data 如何通过使用Excel公式自动将单元格数据的最大值从一个选项卡复制到另一选项卡 - How to copy max value of a cell data from one tab to another tab automatically by using Excel formula 卡在Excel公式中以调用另一张工作表中的数据而不更改单元格引用 - Stuck in excel formula calling data from another sheet without changing cell reference 在 Excel 中引用另一个单元格公式的公式 - Formula to Reference another Cell's Formula in Excel 如何从500个.xls Excel文件中的单元格中获取数据? - How to obtain the data from cell from 500 .xls Excel files? Excel 的多公式到 IF 等于从另一个单元格值复制 - Multi Formula for Excel to IF Equals copy from another cell value Excel:从另一个添加行的工作表的单元格中引用一个公式 - Excel: Reference a formula in a cell from another worksheet where rows are added Excel VBA使用另一个单元格中的值作为条件格式的公式 - Excel VBA use value from another cell as formula for conditional formating 有可能使用公式从Excel中的一个单元格的内容减去另一个单元格的内容吗? - Is it possible to subtract the content of one cell from another in excel using formula?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM