根据范围生成值的公式 [英] Formula to generate a value according to a range
问题描述
我想根据另一个单元格的范围填充一个单元格.就像如果独立单元格的值在12
至16
之间,则从属单元格将填充为-2
,如果独立单元格的值在16
至20
之间,则-1
且20
-24
然后是N
,依此类推:
I want to populate a cell according to the range of another cell. Like if the independent cell has the value between 12
to 16
then the dependent cell will be populated as -2
and if the independent cell has a value between 16
to 20
then -1
and if 20
-24
then N
and so on:
有公式吗?否则我该怎么做?
Is there any formula or how otherwise can I do it?
推荐答案
假定16
位于16-20之间,而不是12-16之间,而N
则是OP的文本计数而不是图像:
Assuming 16
is "between" 16-20 rather than "between" 12-16 and that for N
it is the text of the OP that counts rather than the image:
=LOOKUP(A1,{12,16,20,24},{-2,-1,"N"})
负值,零,小于12的数字以及大于或等于24的正数,空格和文本将返回#N/A
.
Negative values, zero, numbers less than 12 and positive or greater than 24, blanks and text would return #N/A
.
LOOKUP .
这篇关于根据范围生成值的公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!