Percentage Change

W

Wayne Burritt

Hi: I need to calculate percentage changes on the following:
current year ago
A1: -5 B1: 5

I need to calculate the percentage change from a year ago (B1) to current
(A1), if and only if they have the same sign. If either cells do not have
the same sign, I need excel to return "NA".

Thanks, Wayne and Heidi
 
P

Paul

Wayne Burritt said:
Hi: I need to calculate percentage changes on the following:
current year ago
A1: -5 B1: 5

I need to calculate the percentage change from a year ago (B1) to current
(A1), if and only if they have the same sign. If either cells do not have
the same sign, I need excel to return "NA".

=IF(SIGN(A1)=SIGN(B1),(A1-B1)/B1,NA())
 
J

J.E. McGimpsey

If the OP wanted to return the string "NA", rather than an error:

=IF(SIGN(A1) = SIGN(B1), A1/B1 - 1, "NA")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top