Comparison Function

M

Michael

Hi Folks - I have the follwoing data:

Col A Col B Col C
45 50 Increase
60 75 Increase
65 50 Decrease
44 44 Same

Is there a function I can use in Col C to determine if a cell value
increased, decreased or stayed the same? Thanks in advance.

Michael
 
J

JulieD

Hi Michael

one way
=IF(OR(ISBLANK(B1),ISBLANK(A1)),"",IF(B1=A1,"Same",IF(B1-A1>0,"Increase","Decrease")))

this only puts the words in if both A1 & B1 have data in them

Cheers
julieD
 
A

Aladin Akyurek

Also...

=LOOKUP(A2-B2,{-9.99999999999999E+307,0,2.229E-308},{"Decrease","Same","Increase"})
 
J

Jason Morin

In addition to Julie's formula, you could use:

=CHOOSE((B1>A1)+1+(A1=B1)*2,"Decrease","Increase","Same")

However, mine does not take into consideration blanks - I
suppose you could add an IF in there.

HTH
Jason
Atlanta, GA
 
H

Harlan Grove

Jason Morin said:
In addition to Julie's formula, you could use:

=CHOOSE((B1>A1)+1+(A1=B1)*2,"Decrease","Increase","Same")

However, mine does not take into consideration blanks - I
suppose you could add an IF in there.
....

Or

=IF(COUNT(A1:B1)=2,CHOOSE(2+SIGN(B1-A1),"Decrease","Same","Increase"),
"Missing")

Or if this is purely for display,

=IF(COUNT(A1:B1)=2,B1-A1,"Missing")

and give the col C the number format "Increase";"Decrease";"Same".
 

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