Excel Multiple IF / AND / OR Conditions

Pretty simple questions, but I couldn’t find out how it works, and I’ve been looking for an answer for almost a week now.

Example:

/ One number above 0 and one below

  • A1: 1
  • B1: -1

/ Both numbers below 0

  • A1: -1
  • B1: -2

/ Both numbers above 0

  • A1: 9
  • B1: 2

So, I want to check 3 or 4 things.

  • A1 and B1 are below 0 = return "below"
  • A1 and B1 == == 0 or higher 0 return "higher"
  • A1 is below 0 and B1 above 0 returns "above and below"
  • A1 is above 0 and B1 is below 0, returns “above and below”
+4
source share
3 answers
    =CHOOSE(1+(B25<0)+(C25<0), "both above", "above and below", "both below")

I used B25and C25because from your comment I saw that you want to reference these cells.

" " " ", :

=IF(AND(B25<0,C25<0),"both below", IF(B25<0,"below and above",
     IF(C25<0,"above and below","both above")))

p.s.

( ) , . :

=IF(AND(B25<0,C25<0),"both below",
   IF(AND(B25>=0,C25>=0),"both above",
     IF(AND(B25<0,C25>=0),"below and above",
       IF(AND(B25>=0,C25<0),"above and below"))))
+5

:

=IF(MIN(A1,B1)>0,"above",IF(MAX(A1,B1)<0,"below","above and below"))

, A1, B1 .

+4
=IF(AND(A1<0,B1<0),
"below",
  IF(AND(A1>=0,B1>=0),
"above",
  IF(AND(A1<0,B1>0),
"below and above",
   IF(AND(A1>0,B1<0),
"above and below",
""
   )
   )
   )
)
+2
source

Source: https://habr.com/ru/post/1672692/


All Articles