mardi 15 septembre 2020

Excel if and/or

I would like to 'translate' in excel the following condition:

if((A<0 & B<0) OR (B>= 0 & A >=0), ABS(B-A),A-B)

I have tried as follows:

if(or(and(A1<0, B1<0),(B1>=0, A1 >=0), ABS(B1-A1), A1-B1)

but it does not work.

Do you know why?

You can imagine the following as dataset

A   B

-0.2  -0.3
0.2   0.1
0.1   -0.2

Aucun commentaire:

Enregistrer un commentaire