简体   繁体   中英

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.

so for example if i pass 620.000 to this function it should return 800 since it is >= to 600.000 and <= 799.999

在此处输入图像描述

Try this:

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

Assuming the 620 you suggest is in cell d1.

Also cell A2 needs a 0 not -

With index() and match():

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

Sharing two more alternatives,

配方_溶液

OLDSKOOL Approach --> LOOKUP() Function

=LOOKUP(A10,A2:C8)

Modern O365 Approach --> XLOOKUP() Function

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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