Excel IF function greater than x but less than y

余生颓废 提交于 2019-12-12 19:15:17

问题


I'm trying to arrange a column so that I can essentially "score" results.. I am looking for a formula that will go "If greater than 100000 but less than 110000 = 10, if greater than 90000 but less than 99999 = 9, etc etc.. can someone help?


回答1:


We can use LOOKUP with ranges:

=LOOKUP(A2,{0,90000,100000,110000,120000},{"0-89999","90000-99999","100000-109999","110000-119999","120000-Inf"})

I used lookup output as ranges to show what lookup is trying to do, in your case use below:

=LOOKUP(A2,{0,90000,100000,110000,120000},{8,9,10,11,12})



回答2:


You can do this a few ways. Vlookup or summing if statements. Assuming your column you want to score is in column A and you are scoring in column B try these:

Vlookup

(assuming a table is on column c and d)

=VLOOKUP(A1,C1:D2,2)

Ifs

=IF(A1=10000,10,0)+IF(A1=9000,9,0)



来源:https://stackoverflow.com/questions/38232163/excel-if-function-greater-than-x-but-less-than-y

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!