# Difficult Condition in Excel

Tell me, please, how to make a formula for meeting the condition: if the cell value is less than 90, then the result is A, if it is more than 90, but less than 180, then - B, if more than 180, but less than 270, then C, otherwise - D.

I tried the formula `=ЕСЛИ(А1<90;"А";ЕСЛИ(А1>270;"D"))` - but this is only for extreme conditions. Perhaps, it is possible to use the logical operators AND, OR, and so on?

Since the lower boundary conditions are checked in the previous functions, some checks can be removed. If the number does not need to show the text, quotes are also superfluous:

` `=ЕСЛИ(A2<90;1;ЕСЛИ(A2<180;2;ЕСЛИ(A2<270;3;4)))` `

Options:

` `=ПРОСМОТР(A2;{0;90;180;270};{1;2;3;4}) =ВПР(A2;{0;1:90;2:180;3:270;4};2;1)` `

It seems that the sectors of the circle are considered and more than 360 will not. In this case, you can:

` `=ВЫБОР(A2/90+1;1;2;3;4;4) =МИН(ЦЕЛОЕ(A2/90)+1;4)` `

The work of CDF with a range of constants is described here:

use of a range of constants in the CDF function

` `=ЕСЛИ(И(А2>=0;А2<90);"1";ЕСЛИ(И(А2>=90;А2<180);"2";ЕСЛИ(И(А2>=180;А2<270);"3";"4")))` `