简体   繁体   English

基于范围的查找值

[英]Lookup Value based on Range

I am looking for a way where I can look up a value based on a value in another cell.我正在寻找一种可以根据另一个单元格中的值查找值的方法。 In my case i have a scell that holds a sales value and i need to know what the cost would be based in which range it falls in. I know i could do it via endles if statments but i hope there is a way where i can poot on a separate sheet a table in th enclosed pic and the formula would look up which range it would fall under and return the correct charge for the passed in value.在我的例子中,我有一个持有销售价值的 scell,我需要知道它落在哪个范围内的成本是多少。我知道我可以通过 endles if 语句来做到这一点,但我希望有一种方法可以在单独的工作表上打开随附图片中的表格,公式将查找它属于哪个范围,并返回传入值的正确费用。

so for example if i pass 620.000 to this function it should return 800 since it is >= to 600.000 and <= 799.999因此,例如,如果我将 620.000 传递给此 function,它应该返回 800,因为它 >= 到 600.000 且 <= 799.999

在此处输入图像描述

Try this:尝试这个:

=vlookup(d1,a2:c8,3,1)

Assuming the 620 you suggest is in cell d1.假设您建议的 620 在单元格 d1 中。

Also cell A2 needs a 0 not -单元格 A2 也需要 0 而不是 -

With index() and match():使用 index() 和 match():

=index(c2:c8,match(d1,a2:a8,1))

Sharing two more alternatives,分享另外两个选择,

配方_溶液

OLDSKOOL Approach --> LOOKUP() Function OLDSKOOL方法 --> LOOKUP() Function

=LOOKUP(A10,A2:C8)

Modern O365 Approach --> XLOOKUP() Function 现代 O365方法 --> XLOOKUP() Function

=XLOOKUP(A10,A2:A8,C2:C8,"None",-1)

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

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