[英]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.