ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Comparison Function (https://www.excelbanter.com/excel-worksheet-functions/9646-comparison-function.html)

Michael

Comparison Function
 
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








JulieD

Hi Michael

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

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

Cheers
julieD



"Michael" wrote in message
news:wutId.20293$B95.14346@lakeread02...
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










Aladin Akyurek

Also...

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

Michael wrote:
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








Jason Morin

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

=CHOOSE((B1A1)+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

-----Original Message-----
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







.


Michael

Julie - Thanks. I understand your example the best. Thanks to all!!

Michael



"JulieD" wrote in message
...
Hi Michael

one way

=IF(OR(ISBLANK(B1),ISBLANK(A1)),"",IF(B1=A1,"Same" ,IF(B1-A10,"Increase","De
crease")))

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

Cheers
julieD



"Michael" wrote in message
news:wutId.20293$B95.14346@lakeread02...
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












JulieD

Hi Michael

you're welcome and thanks for the feedback.

Cheers
JulieD

"Michael" wrote in message
news:yOuId.20294$B95.1409@lakeread02...
Julie - Thanks. I understand your example the best. Thanks to all!!

Michael



"JulieD" wrote in message
...
Hi Michael

one way

=IF(OR(ISBLANK(B1),ISBLANK(A1)),"",IF(B1=A1,"Same" ,IF(B1-A10,"Increase","De
crease")))

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

Cheers
julieD



"Michael" wrote in message
news:wutId.20293$B95.14346@lakeread02...
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














Harlan Grove

"Jason Morin" wrote...
In addition to Julie's formula, you could use:

=CHOOSE((B1A1)+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".




All times are GMT +1. The time now is 04:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com