VBA Solution To Compare/replace Data Between Columns
Jul 4, 2009
I have two columns of adjacent data Call them A & B (although this could differ)
If the data in the second colum is not equal to, blank cell or contains the words "CAT", "DOG" or "ELEPHANT" then the content of the cell in the second column should REPLACE the content of the adjacent cell in column A (in this example) leaving B blank, otherwise column B remains unchanged.
View 9 Replies
ADVERTISEMENT
Mar 14, 2013
I have 2 sheets similar to below :
Sheet1
apple pc
sony camera
lenovotablet
apple laptop
Sheet2
sony television
lenovopc
I need to compare Column A from Sheet2 with Sheet1 and where the values match, only replace THOSE values in Column B of Sheet1 with those in Column B of Sheet2. Hence, after the replacement, Sheet1 should look like (value for apple remains unchanged).
apple pc
sony television
lenovopc
apple laptop
What would be a formula that would do it ?
View 1 Replies
View Related
Jun 30, 2007
at first i wrote company's name short so that i have to type less but now i want full name of company.....
like.....if in sheet#1 column B any company's name is started by Rel of sheet#2 column A , then the cell containing Rel is replaced by Reliance Industries ( sheet#2 column B but same row that of Rel) ........in sheet#1
sheet#1
A...................................B
ROSS...........................Rel
PETER..........................Reliance
JACK...........................Moser
CHANDLER...................Wip
JAMES.........................Micro
sheet#2
A..................................B
Rel...............................Reliance Industries
Moser...........................Moserbaer
Micro............................Microsoft
Wip..............................Wipro................................
View 9 Replies
View Related
Jan 26, 2009
I have column A with 228 rows and column D with 314 rows. Both columns have the same data except that D has different data. I would like to line up everything that is the same in A and D and everything else in column D that is not the same move to G. Is there a quick way to do this?
View 5 Replies
View Related
Jul 10, 2008
i want to compare data between 4 columns, 2 columns of data is in Sheet 1 and 2 columns of data is in sheet2. Data starts at A5 in both worksheets. Data consists of stock codes and there holdings. Sheet 1 data is real data the primary source, sheet 2 data is a bit of real data and incorrect data.
My data in sheet 1 is layed out as below, this is just a sample, real data has around 1500 stock codes and holdings.
Starting at A5
Col A (Stock) Col B (Holdings)
5 aap 10500
6 aax 10987
7 aas 76544
Sheet 2 data is layed out as above but holdings may differ, so
Col A(Stock) Col B (Holdings)
5 aap 10500
6 aax 10300
7 aas 76534
I need a formula which will tell me which stocks holdings have changed in sheet 2 compared to sheet1.
View 9 Replies
View Related
Dec 29, 2009
I'm working with Excel 2007, I have two tabs on my spreadsheet, each tab contains a column of numbers formatted like 5552220. Is there a way to run a macro or write a formula that would compare the data between the two columns and either automatically delete the numbers that don't have a match or highlight them? For example:
Tab A Tab B
5551112 5551112
6660001 6660001
1234567 1234567
2222222 2222222
6666445
6666445 needs to be deleted in tab B because it's not present in tab A. There could be up to 100 numbers that require deletion from tab B.
View 9 Replies
View Related
Oct 10, 2006
I have 2 columns say A and B (infinite number of rows)
A is an Indexed number starting at 1
B is numerical data.
I now have a second set of the same columns with the same data, however some rows are missing. I need a way of comparing the data and then display the rows I am missing in the second set of columns.
For example the first set will be the master list and look like:
Index Data
1 34
2 46
3 54
4 276
5 311
6 89
Second list has row 2 and row 5 missing.
Index Data
1 34
3 54
4 276
6 89
The desired result is to have the missing rows displayed;
Index Data
2 46
5 311
View 4 Replies
View Related
Feb 9, 2010
Is there a way to test out a formula using Excel that has more than 2 variables? (If only 2 variables, I would use a simple data table). The formula I am testing has 50X50X20 variables (and as a subset, each variable has 2500 lines of assumptions!). I don't need to see all the results, only the result that produces the highest result. For simplicity (if someone has an answer) let's assume 3 variables are A1, A2 and A3. Formula is in A4 and formula is A1+A2+A3. Assuming A1 can be 1 to 5 and A2 same , A3 same, the long hand calc is for me to run a data table using variables in A1 and A2 the fixing A3 (as 1)..note maximum result....then run data table again using variables in A1 and A2 and changing fixed value in A3 to the number 2...and so on and so on....in this simple example I know the max result would be 15, but much more difficult in my spreadsheet test.
View 9 Replies
View Related
Nov 10, 2013
I have 2 sets of data/array/range. Each set consists of 2 columns with a large number of rows.
I want to compare my 2nd data to a master data. And list if anything is different in 2nd set of data from master set in column A than highlight the difference or copy the value to another place.
Also want to compare the 2nd column if column A was same and consider both column A and column B for that associated row different if column B is different.
The trouble for me comes in because the list is never alphabetical (sort doesnt work cause of funky naming) and never of the same size.
Attached is a photo of an example for maybe an clearer understanding. Also attached an example excel sheet I tried it within excel but cant seem to figure out how to look also for the 2nd column, so im trying to avoid the within excel route and go using vba ...
T3OCcxw.jpg
example.xlsx
I attempted it with a very basic code thats not working =/ just cant seem to figure how to code to get the desired result
VB:
Sub matchdiff()
Dim cell As Range
Dim found As Range
[Code].....
View 1 Replies
View Related
Jul 31, 2012
I have 2 worksheets in 2 spreadsheets 1 & 2. I would like to compare columns A & G in 2 to 1. If columns A & G in worksheet 2 matched worksheet 1, then it will fill in columns B, C, D, and AL automatically.
View 1 Replies
View Related
Oct 26, 2012
I'm having difficulties using vlookup to compare two columns of TEXT data. My goal is find out how many of items in the "Eligible Serial Numbers" list have been ordered for destruction. The items listed for destruction are listed in the "Serial Numbers (destroyed).
Whenever I put in a VLOOKUP, I get a serial number that doesn't make sense to me. For example, if I want to find out if "362351581" from the Eligible List appears on the destroyed list. What do you suggest?
Code:
Destroyed? (i.e. Vlookup formula in this column)
Eligible Serial Numbers
Serial Numbers (destroyed)
362351581
362351581
[Code]....
View 9 Replies
View Related
May 9, 2013
I have account numbers in Col A and in Col D .I would like a macro to highlight the color the items in Col D that are not in col D. Blanks can be ignored
View 3 Replies
View Related
Apr 3, 2014
I have one column which contains suppose first names & i have other two column which contains first name & last name in same sheet but like they may be having in g & h column.
so i want to exact last name of user form that column(g & h) to my first name column(a).
View 1 Replies
View Related
May 9, 2014
Looking for some code to do a simple compare column A to Column B (row 1 contains headings) and highlight any differences.
View 3 Replies
View Related
Feb 18, 2014
I'm using the code below to compare columns on two sheets (1 column for each) and where there is a match, copy data from the 'Source' to 'Destination' sheet.
[Code] ...........
The code works fine, but I'd like to amend this, but I'm a little unsure about how to proceed.
The script currently compares column C on the 'Source' sheet with column D on the 'Destination' sheet and where a match is found copy column G from the 'Source' sheet and pastes this to column O on the 'Destination' sheet.
I'd still like to copy and paste the same columns, but I'd like to compare two columns from each sheet, so from the 'Source' sheet compare columns C and E to columns D and J on the 'Destination' sheet.
View 2 Replies
View Related
Jun 27, 2014
I have two sets of data from columns A:N (O is blank) & P:AC. Column A & P are account numbers. I want to compare columns A & P for exact matches, there will never be any duplicates in either of these columns by themselves. If there is a match I would like that entire row to align, if there is no match I would like a row to be inserted. I have attached a copy of a worksheet of what I am looking to have done.
View 2 Replies
View Related
Apr 16, 2014
How can I compare the data of two columns, and if the same, to show me the number from a third column? I upload a quick sample
View 4 Replies
View Related
Jul 22, 2012
I have an Excel macro which works well in comparing two columns A and B. It populates column C with unique values in A and not in B, populates column D with unique values in column B and not in A and puts the values found in both A and B in the fifth column (E).
Data in the columns A and B of Sheet 1 has exceeded 1,048,576 (the maximum allowable in Excel 2007) and i will copy the overflow data in Sheet 2's column A and B and i will like the comparison to continue in the next worksheet.
I need the macro to treat the second worksheet as a continuation of the first sheet and not as a separate data. (The values i am comparing have exceeded 1million).
Sub twocols()
Dim d As Object, na&, nb&, a, b
Dim e, p&, q&, r&, m
Set d = CreateObject("scripting.dictionary")
[Code] .......
View 2 Replies
View Related
Mar 2, 2007
I would like to compare some keyword lists if possible.
I have a large list of Unique keywords in Col A (From A3),
This Column is called Keyword List A - Large"
I then have a keyword list in Column C (From Cell C3),,
This Column is called "Keyword List B - Small.
I then have a column called "Unique Keywords Found",, This is Col E,, with hopefully returned results being entered from cell E3 downwards.
What I would like to be able to do if possible is run a Macro that would compare all the unique words in ColA and C and return only the difference, (The Unique words not found in ColC as Col A is the "Master List")
If possible could a pop up box appear saying
===================
List A No Rows:xyz
List B No Rows: xyz
No of Uniques Found : xyz
Time Elapsed (sec): xyz
===================
I'm running windows XP and Excel 2007.
View 9 Replies
View Related
Aug 6, 2008
searching between 2 columns (A:B) and finding duplicate emails using some type of formatting that will highlight duplicate emails?
For example?
A B
me@yahoo.comsmelly@yahoo.comegg@msn.comspazz@guno.comdupada@hotmail.comhope@aol.comokay@gmail.comhelp@popp.comhope@aol.comfunky@chicken.com
check@team.com hope@aol.com
I am using MS Excel 2007 and not very experienced, but this is for a marketing golf tournament my company is hosting.
View 9 Replies
View Related
Aug 25, 2009
I have 2 Excel files that have 2 columns in each.
Product# and Price.
The Product#'s in the 1st sheet are in correct order and have outdated prices.
In the 2nd file the Product#'s are same but they cannot be sorted the same way as the 1st file. So I cannot just copy the column of updated prices from 2st one and paste it into the 1st.
So, my best bet would be to run a script or something that will get a Product# from 2nd file and find it in 1st, if it matches then copy the new price to the 1st file.
View 7 Replies
View Related
Apr 26, 2007
I've searched the board for something close to reverse-engineer but no luck. I'm looking for a macro that will:
Examine values in Sheet 1, column B
Compare them to values in Sheet 2, column A then...
wherever there's a match copy the the corresponding cell contents of Sheet 2, column B into the corresponding cell of Sheet 1, column A
What I'm trying to do is append the description of a 4-letter code (from a reference Sheet 2) beside where that code appears in Sheet 1.
There won't be a row-to-row correspondence in the match, i.e ABCD might be in (Sheet 1)B45 and (Sheet 2)A920...
View 9 Replies
View Related
Sep 7, 2007
My problem description is as follows
I have to create a merged file from two input files.These are
1.The first input file is generated by the tool.This file contains the error message description stored in columns.For the coresponding error message a unique identifier is assigned by tool.
Identifier is in different column in same sheet. The error message has title also.
The sheet can be represented as follows ....
View 9 Replies
View Related
Mar 31, 2007
I have column A and column B:
I will be inputting data into column B.
I need excel to check to see if the data I input into column B is an exact match to the data in column A.
If it is an exact match, then column B will remain blank.
If the data in column B is different, I need column B to show the following:
No match: <data>
Example I input in column B the following:
Column A Column B
1. Car Car
2. 4357 9999
3. fsd34d 4erd
4. 98dkf 98dkf
Spreadsheet should show:
Column A Column B
1. Car
2. 4357 No match: 9999
3. fsd34d No match: 4erd
4. 98dkf
(Cell 1 and 4 in column B are empty because they are exact matches to Column A cell 1 and 4)
My questions:
1) How does the excel formula need to be written for this to work?
2) Is there a way to set it so that when I do a mass copy to data into column B that the formula will not be overwritten and it will still check to see if the data I copy and pasted into that column matches the data next to it in column A?
View 14 Replies
View Related
Mar 23, 2014
I have a spreadsheet with 2 tabs:
AllData:
Name
Data
Read1
[Code]....
View 9 Replies
View Related
Sep 11, 2013
Here's how my daily report is currently set up:
ExternalInternalDifferences
123000123000
234564234564
345456345456
456567378987
565456456567
654547524564
788879565456
865478654547
745654
788879
865478
The External column contains data provided by an external vendor. The Internal column contains data compiled internally. The data in the Internal column will always contain data duplicate to the External column, but will also contain unique data not present in the External column. I would normally cut out the data contained in Internal column that is not duplicated in the External column, and paste it into the Differences column, and move the remaining cells in the Internal column up. The result would be the External column data and Internal column data would align by row, and the data unique to the Internal column is segregated to the Differences column, like so:
ExternalInternalDifferences
123000123000378987
234564234564524564
345456345456745654
456567456567
565456565456
654547654547
788879788879
865478865478
While not a difficult task for 8 rows of data, the actual daily report contains over 1000 rows, on average. I would like to set up a template workbook, where I can simply open the template workbook, paste the data into both the External and Internal columns, then have the values that are unique to the Internal column extracted from the Internal column and inserted into the Differences column.
The end product would be used daily, with differing amounts of data (from 100 rows to 10,000 rows).
View 8 Replies
View Related
Apr 19, 2013
I'm sure this query has been answered somewhere else but I can't seem to find it. I basically have information in two worksheets in the same workbook which need to be compared and the missing values from one worksheet need to be listed in a message. There are duplicate values in both worksheets so only need a list of the unique missing values. For example:
Sheet1
Column A
1
2
1
5
5
2
3
5
4
Sheet2
Column A
2
3
3
4
3
4
The message box should state that we are missing 1 and 5 from the dataset as it is not in Sheet2. If the list could be sorted in ascending order that would be great too.
View 9 Replies
View Related
Mar 2, 2007
I'm trying to do is compare 4 columns on 2 sheets. I would like to go down in column "E" on sheet1 and find the exact one on column "A" on sheet2. Once these are equal I would compare F, G, H, on sheet1 with B, C, D on sheet2. If the these three columns are not the same I would like to copy from sheet2 B, C, D from sheet2 to F, G, H.
The problem I have is none of the rows of information will be in sequential order as well as we may not have a match. What I'm saying is row1 on sheet1 could be row1000 on sheet2. Attached is a small example. in the example rows 6, 11, 12, 16 and 19 would be the only changes on sheet1. My example does have the rows in sequential but that would almost never be the case for me....
View 9 Replies
View Related
Jan 23, 2006
I am trying to compare multiple column in a worksheet to find
common component in all the columns and what is unique to a particular
column only. And list the results/finding in adj column. What i am
trying to accomplish is something as below.
BEFORE
Sheet1 Sheet2 Sheet3
Column2 Column2 Column2
02-1234-12 07-1234-12 02-1234-12
04-1234-12 03-1234-12 02-1234-12
05-1234-12 02-1234-12 06-1234-34
AFTER
Common to all Unique to sheet1 Unique to Sheet2
02-1234-12 05-1234-12 07-1234-12
View 14 Replies
View Related
Aug 9, 2012
I have 29 excel files with some number of worksheets from 1 to 4. The name of the worksheets are the same in all the spreadsheets. Then I've a got a pivot table. I have to compare some data (3 columns) from the pivot table to the numbers from all these sheets from 29 excel files.
How to do it in a most efficient way?
View 4 Replies
View Related