Comparing cells
-
- Posts: 6
- Joined: Fri Mar 14, 2008 5:09 pm
Comparing cells
Hi,
I've been searching for such function / macros for ages.
Imagine you need to compare several sells values and get common values listed in separate cell. Here is the sample:
A1 = 30
A2 = 43
A3 = 35
--------
B1 = 50
B2 = 34
B3 = 35
C1 = 35 (this sell should contain a formula, not a value)
The same goes for comparing text values. To give you a better picture of why the hack do I need this function I'll tell you that I have a long list of URLs and another short one and so I need to compare them and have matching values in a third list.
I've been searching for such function / macros for ages.
Imagine you need to compare several sells values and get common values listed in separate cell. Here is the sample:
A1 = 30
A2 = 43
A3 = 35
--------
B1 = 50
B2 = 34
B3 = 35
C1 = 35 (this sell should contain a formula, not a value)
The same goes for comparing text values. To give you a better picture of why the hack do I need this function I'll tell you that I have a long list of URLs and another short one and so I need to compare them and have matching values in a third list.
Re: Comparing sells
C3: =IF(A3=B3;A3;"")
Is this what you want?
Is this what you want?
James
www.8daysaweek.co.uk - A User-Focused OOo site.
Windows Easy Installation CDs & OOo on USB Keys, OOo for Mac OS X + Ubuntu CDs
Please read: Survival Guide for the forum
OOo 3.1.1 on Ubuntu 9.x + Windows XPP, Mac OS X
www.8daysaweek.co.uk - A User-Focused OOo site.
Windows Easy Installation CDs & OOo on USB Keys, OOo for Mac OS X + Ubuntu CDs
Please read: Survival Guide for the forum
OOo 3.1.1 on Ubuntu 9.x + Windows XPP, Mac OS X
-
- Posts: 6
- Joined: Fri Mar 14, 2008 5:09 pm
Re: Comparing sells
I wish it was that simple:-) What I mean is to compare every sell from a first massive with a first sell from a second massive, then do the same for the second sell of a second massive and so on...James wrote:C3: =IF(A3=B3;A3;"")
Is this what you want?
Re: Comparing sells
Sorry I don't understand. I'm assuming you mean "cell" as in a box on a spreadsheet, not "sell"?
What is a "massive"?
Are you saying you want to compare cell A1 in 2 separate spreadsheets? Your example in your first post suggested comparing values in 2 columns (A & B):
What is a "massive"?
Are you saying you want to compare cell A1 in 2 separate spreadsheets? Your example in your first post suggested comparing values in 2 columns (A & B):
How long is your list of values?JasonBourne wrote:Imagine you need to compare several sells values and get common values listed in separate cell. Here is the sample:
A1 = 30
A2 = 43
A3 = 35
--------
B1 = 50
B2 = 34
B3 = 35
C1 = 35 (this sell should contain a formula, not a value)
The same goes for comparing text values.
James
www.8daysaweek.co.uk - A User-Focused OOo site.
Windows Easy Installation CDs & OOo on USB Keys, OOo for Mac OS X + Ubuntu CDs
Please read: Survival Guide for the forum
OOo 3.1.1 on Ubuntu 9.x + Windows XPP, Mac OS X
www.8daysaweek.co.uk - A User-Focused OOo site.
Windows Easy Installation CDs & OOo on USB Keys, OOo for Mac OS X + Ubuntu CDs
Please read: Survival Guide for the forum
OOo 3.1.1 on Ubuntu 9.x + Windows XPP, Mac OS X
-
- Posts: 6
- Joined: Fri Mar 14, 2008 5:09 pm
Re: Comparing sells
Ok, I guess it's because of it's Friday:-) Yes, I mean cell, not sell:-).
I'm gonna give you a more illustrative sample to clarify the whole thing.
I need to compare cell values on a single sheet.
A1 = http://www.google.com
A2 = http://www.yahoo.com
A3= http://blah-blah.com
B1 = http://www.Iguessnowitlooksbetter.com
B2 = http://www.yahoo.com
B3 = http://www.thanksgoditsfridayalready.com
C1 = http://www.yahoo.com (formula)
I'm talking about several thousands values in A column and several hundreds in B column and I need to have matching values for the column A and B at column C
I'm gonna give you a more illustrative sample to clarify the whole thing.
I need to compare cell values on a single sheet.
A1 = http://www.google.com
A2 = http://www.yahoo.com
A3= http://blah-blah.com
B1 = http://www.Iguessnowitlooksbetter.com
B2 = http://www.yahoo.com
B3 = http://www.thanksgoditsfridayalready.com
C1 = http://www.yahoo.com (formula)
I'm talking about several thousands values in A column and several hundreds in B column and I need to have matching values for the column A and B at column C
Re: Comparing sells
Is that C1 or should it / could it be C2?JasonBourne wrote:C1 = http://www.yahoo.com (formula)
James
www.8daysaweek.co.uk - A User-Focused OOo site.
Windows Easy Installation CDs & OOo on USB Keys, OOo for Mac OS X + Ubuntu CDs
Please read: Survival Guide for the forum
OOo 3.1.1 on Ubuntu 9.x + Windows XPP, Mac OS X
www.8daysaweek.co.uk - A User-Focused OOo site.
Windows Easy Installation CDs & OOo on USB Keys, OOo for Mac OS X + Ubuntu CDs
Please read: Survival Guide for the forum
OOo 3.1.1 on Ubuntu 9.x + Windows XPP, Mac OS X
-
- Posts: 6
- Joined: Fri Mar 14, 2008 5:09 pm
Re: Comparing sells
Well I'm giving a sample where there is only one match, but it's possible to have several and I want to have them listed in column C.
Re: Comparing sells
That (the answer to my Q) doesn't matter as much as - how automated do you want this to be?
For instance, using the formula I pasted above, you could:
.
For instance, using the formula I pasted above, you could:
- Drag that down the entire sheet
- Copy column C and paste values into column D
- Sort column D to remove blanks

James
www.8daysaweek.co.uk - A User-Focused OOo site.
Windows Easy Installation CDs & OOo on USB Keys, OOo for Mac OS X + Ubuntu CDs
Please read: Survival Guide for the forum
OOo 3.1.1 on Ubuntu 9.x + Windows XPP, Mac OS X
www.8daysaweek.co.uk - A User-Focused OOo site.
Windows Easy Installation CDs & OOo on USB Keys, OOo for Mac OS X + Ubuntu CDs
Please read: Survival Guide for the forum
OOo 3.1.1 on Ubuntu 9.x + Windows XPP, Mac OS X
-
- Posts: 6
- Joined: Fri Mar 14, 2008 5:09 pm
Re: Comparing cells
Well, now I'm sitting at home with my Macbook on my laps and trying your suggestion
1. Ok, I think you still can't get my point:-) A formula which I want to place on column C should do the following:
Compare Every cell from column A with a first cell from column B. Keep in mind that it's possible that identical to B1 cell value could be located in ANY cell of a column A, from A1 to An, where n - is a given number of cells for a particular case
2.After comparing the first cell of a column B with every single cells value in column A do the same with the second cell of a column B (B2) and so on
Thanks a lot for your help!

1. Ok, I think you still can't get my point:-) A formula which I want to place on column C should do the following:
Compare Every cell from column A with a first cell from column B. Keep in mind that it's possible that identical to B1 cell value could be located in ANY cell of a column A, from A1 to An, where n - is a given number of cells for a particular case
2.After comparing the first cell of a column B with every single cells value in column A do the same with the second cell of a column B (B2) and so on
Thanks a lot for your help!

Re: Comparing cells
Ah! Now I understandJasonBourne wrote:A formula which I want to place on column C should do the following:
Compare Every cell from column A with a first cell from column B.

James
www.8daysaweek.co.uk - A User-Focused OOo site.
Windows Easy Installation CDs & OOo on USB Keys, OOo for Mac OS X + Ubuntu CDs
Please read: Survival Guide for the forum
OOo 3.1.1 on Ubuntu 9.x + Windows XPP, Mac OS X
www.8daysaweek.co.uk - A User-Focused OOo site.
Windows Easy Installation CDs & OOo on USB Keys, OOo for Mac OS X + Ubuntu CDs
Please read: Survival Guide for the forum
OOo 3.1.1 on Ubuntu 9.x + Windows XPP, Mac OS X
Re: Comparing cells
Does it matter whether there are repeated values e.g. if the value in B1 appears 3 times in Column A?
James
www.8daysaweek.co.uk - A User-Focused OOo site.
Windows Easy Installation CDs & OOo on USB Keys, OOo for Mac OS X + Ubuntu CDs
Please read: Survival Guide for the forum
OOo 3.1.1 on Ubuntu 9.x + Windows XPP, Mac OS X
www.8daysaweek.co.uk - A User-Focused OOo site.
Windows Easy Installation CDs & OOo on USB Keys, OOo for Mac OS X + Ubuntu CDs
Please read: Survival Guide for the forum
OOo 3.1.1 on Ubuntu 9.x + Windows XPP, Mac OS X
Re: Comparing cells
Example:
I have this in columns A and B:
q s
w t
e f
r u
t h
y o
u k
I
o
p
a
s
d
f
g
h
j
k
In C1, I put this: =IF(ISNA(OFFSET(A1;MATCH(B1;$A$1:$A$19;0)-1;0));"No Match";OFFSET(A1;MATCH(B1;$A$1:$A$19;0)-1;0))
Copy down column C.
With an "s" in B1, I got an "s" in C1. With anything not in the list of column A, I got "No match".
David.
I have this in columns A and B:
q s
w t
e f
r u
t h
y o
u k
I
o
p
a
s
d
f
g
h
j
k
In C1, I put this: =IF(ISNA(OFFSET(A1;MATCH(B1;$A$1:$A$19;0)-1;0));"No Match";OFFSET(A1;MATCH(B1;$A$1:$A$19;0)-1;0))
Copy down column C.
With an "s" in B1, I got an "s" in C1. With anything not in the list of column A, I got "No match".
David.
Re: Comparing cells
OK one way to do it, similar to the method I posted before, is to use:
=IF(ISNA(VLOOKUP(B1;$A$1:$A$65536;1;0))=1;"No match";VLOOKUP(B1;$A$1:$A$65536;1;0))
If you enter this formula in Column D it will tell you if the value is unique or not:
=IF(COUNTIF($A$1:$A$65536;C1)>1;COUNTIF($A$1:$A$65536;C1);"")
HTH,
=IF(ISNA(VLOOKUP(B1;$A$1:$A$65536;1;0))=1;"No match";VLOOKUP(B1;$A$1:$A$65536;1;0))
If you enter this formula in Column D it will tell you if the value is unique or not:
=IF(COUNTIF($A$1:$A$65536;C1)>1;COUNTIF($A$1:$A$65536;C1);"")
HTH,
Edit: Changed hyphen to "No match" so that result is similar to Dave's post |
James
www.8daysaweek.co.uk - A User-Focused OOo site.
Windows Easy Installation CDs & OOo on USB Keys, OOo for Mac OS X + Ubuntu CDs
Please read: Survival Guide for the forum
OOo 3.1.1 on Ubuntu 9.x + Windows XPP, Mac OS X
www.8daysaweek.co.uk - A User-Focused OOo site.
Windows Easy Installation CDs & OOo on USB Keys, OOo for Mac OS X + Ubuntu CDs
Please read: Survival Guide for the forum
OOo 3.1.1 on Ubuntu 9.x + Windows XPP, Mac OS X
-
- Posts: 6
- Joined: Fri Mar 14, 2008 5:09 pm
Re: Comparing cells
It does work!!!!
Thanks James, you've saved tons of my time!!!!
Thanks James, you've saved tons of my time!!!!
Last edited by JasonBourne on Sat Mar 15, 2008 12:00 am, edited 2 times in total.
Re: Comparing cells
No problem 

James
www.8daysaweek.co.uk - A User-Focused OOo site.
Windows Easy Installation CDs & OOo on USB Keys, OOo for Mac OS X + Ubuntu CDs
Please read: Survival Guide for the forum
OOo 3.1.1 on Ubuntu 9.x + Windows XPP, Mac OS X
www.8daysaweek.co.uk - A User-Focused OOo site.
Windows Easy Installation CDs & OOo on USB Keys, OOo for Mac OS X + Ubuntu CDs
Please read: Survival Guide for the forum
OOo 3.1.1 on Ubuntu 9.x + Windows XPP, Mac OS X
-
- Posts: 4
- Joined: Thu Feb 05, 2009 3:16 pm
Re: Comparing cells
I'm right now trying to find a macro that does this for only one column- find identical values/strings in different cells of the same column. Doesn't work by now, but I'm still trying.
Ok, found the solution:
I got the german version of OpenOffice.Org.
The parameters are all in german, as IF becomes WENN, COUNTIF becomes VERGLEICH and so on.
This formula does work:
It will deliver the last line where the identical value of the given line is found. When there is no identical line, nothing will be shown.
Ok, found the solution:
I got the german version of OpenOffice.Org.
The parameters are all in german, as IF becomes WENN, COUNTIF becomes VERGLEICH and so on.
This formula does work:
Code: Select all
=WENN(VERGLEICH(J1;$J$1:$J$65536;1)=ZEILE(J1);"";VERGLEICH(J1;$J$1:$J$65536))
OOo 3.0.X on Ms Windows XP
Re: Comparing cells
I'm probably missing something important, but doesn't this do what you want?
- Attachments
-
- common.ods
- (9.43 KiB) Downloaded 208 times
AOO4/LO5 • Linux • Fedora 23