|I have a IF AND statement which works in |
Access as a SQL query but I can not get it to
work in Excel as a formula.
If X is yesterday and Y is today then I need the
% change, I have.
Y\X - 1
Where X and Y can be 0, further if
X>Y %change= - #
Y=0 %change= - X
In Access I have
IIF(X<>0 AND Y\X<>0,Y\X-1, Y-X)
Which seems to work I get no error msg. and
in testing gives the correct answers.
In Excel I have
IF(AND(X<>0, Y\X<>0), Y\X - 1, Y-X)
Which gives me the error: dividing by zero.
Is there a way to make this work in Excel or
can you see a better way to do this.