Forum Discussion
Comparing the data of 2 columns
- Jul 15, 2018
So you can just use an IF condition:
IF(H1="same";"";if(H1=H2;"same";"different"))
You need to use formulas when you set cells. A1:A4=B1:B4 is not a formula and the machine does not understand what are you looking for.
You said: "I so far used an IF function such that I would get 0 if the answers of two cells are identical and 0 if there are not identical."
I assume you made an error in typing, if not, if you assign 0 if something is true and 0 if something is not true, it's ok that the result is always 0.
Can you please attach here a sample file with a couple of rows of data, just to understand the mechanics you're looking for?
I asked that because "(i.e. comparing column 1 of set 1 with column 1 of set 2 etc.)" it's not self explanatory and that "etc" does not give me idea of what you need.
Thanks for the attention, bye!
Hi Arul,
Good point!
Here's two columns with example rows of data. Basically, I'm just trying to get a new column which contains the information whether the rows of the two presented columns match or not (i.e. if both say decreased in the same row). However, I would like to exclude 'same' such that when comparing a 'same' answer in a row of the first column with either an 'increased', 'decreased' or 'same' answer in the same row of the second column, they would never be treated as 'different' answers outputs in the formula. In other words, I would only like to compare whether 'increased' or 'decreased' in the first column rows change in their according second column row.
Hope it's a bit clearer now and many thanks for your help!
- Arul TresoldiJul 15, 2018Iron Contributor
So you can just use an IF condition:
IF(H1="same";"";if(H1=H2;"same";"different"))
- Alexander FriesJul 15, 2018Copper Contributor
Worked - many thanks!!