Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I compare data from one cell against another?

Status
Not open for further replies.

davesaint86

IS-IT--Management
Aug 23, 2007
10
0
0
US
How do I compare the data in one cell to find out if the data is different from another cell? For example - Say if the first block of data (below) is in A2 and the second block of data is in B2. Both blocks of data contain the same data but the data is sorted in a different order. I could create a formula =A2=B2. If I did this it would give me a return of "false". I'm not looking for this answer. I'm looking for a forumula or a solution that would give me a false reading if the data is different between two cells regardless if the data is not in the same sort order as the other cell. Is this possible? If so how? I need a workaround. I have to compared 3000 line items. Some of the cells contain multiple strings of data.


A23.020.180.010,Finish to Start,0;A23.020.180.020,Finish to Start,9d;A23.020.180.030,Finish to Start,0


A23.020.180.030,Finish to Start,0;A23.020.180.020,Finish to Start,9d;A23.020.180.010,Finish to Start,0
 




Hi,

"...Both blocks of data contain the same data ..."

They may contain the same data but they are not equal. You would have to test the individual characters in one cell against the other to FIND a value, using the InStr function.

you'd have to check that there is a one to one for each character, even if some characters are repeated.

Skip,
[sub]
[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue][/sub]
 




Consider a process like this, using your macro recorder to record as many steps of this as you can.

Create a sheet on which to copy each cell's data. (Lets say copy to D1 & D3

Parse each cell by one character - ie zxc123 would parse into 6 columns in one row; z x c 1 2 3

Copy the cells containing the parsed data

Paste Special - TRANSPOSE (the TWO columns of transposed data from each of the two original cells ought to by side by side, separated by an empty column.

SORT each column of characters (Lets assume that these start in A1 and C1).

If A1 = C1 and A2 = C2 and ... you have a TRUE.






Skip,
[sub]
[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top