查找在第2轮之间的两个给定值之间的范围内的值 [英] Looking up a value in a range that is between two given values round 2
问题描述
我的初始问题在这里回答:
查找在两个给定值之间的范围内的值
My initial question was answered here: Looking up a value in a range that is between two given values
但是当尝试与更多的结果相同时数据行不止一个,我很挣扎。这是一个屏幕截图:
But when trying to achieve the same result with more data rows than just one, I am struggling. Here is a screen shot :
所以,如果我键入542515,需要看P5和P6 / Q5和Q6
,看到542515是工作8584,因此在输出必须显示8584.如果我在544360和544400之间输入,那么它需要输出8586。
So, if I type 542515 in, it needs to look at P5 and P6 / Q5 and Q6 and see that 542515 is job 8584 and therefore in the output it must show 8584. If I input between 544360 and 544400 then it needs to output 8586.
希望这是有道理的!
推荐答案
如果您的列中的范围 P
和 Q
do 不重叠,那么您可以使用<$($)$ $>来检查 N5
中的输入值c $ c> IF 公式。如果在范围内找不到输入,我的 IF
公式默认为0。然后,我 SUM
在 O
列中找到匹配的工作。
If your ranges in columns P
and Q
do not overlap, then you can simply check the input value in N5
against each range using an IF
formula. My IF
formula defaults to a value of 0 if the input cannot be found in the range. Then I SUM
over the O
column to find the job which matched.
Formula in O5:
=IF(AND(N$5 > P5, N$5 < Q5), M5, 0)
O6中的公式:
=IF(AND(N$5 > P6, N$5 < Q6), M6, 0)
O8中的公式:
=SUM(O5:O6)
这篇关于查找在第2轮之间的两个给定值之间的范围内的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!