multiple excel if statements to produce value 1,2 or 3

后端 未结 3 1627
抹茶落季
抹茶落季 2020-12-07 06:06

I am trying to find out the right if statement to use for this task:

if B5 is higher than C5 = 1
if B5 is within 2% higher than C5 = 2
if B5 is lower than C5         


        
3条回答
  •  时光说笑
    2020-12-07 06:35

    I haven't used excel for years, so I'm not sure as to the exact syntax, but you can you nested if-else statements to achieve this sort of thing. i.e. something to the effect of:

    if (B5 is within 2% higher than C5)
        print 2
    else if (B5 is higher than C5)
        print 1
    else
        print 3
    

提交回复
热议问题