Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
cisq1
 
Posts: n/a
Default Find then If then Replace

hi , i have 2 x files
file 1
col1 col2 col3 col4
abc 123 text1a
def 456 text2a
def 789 text3a
ghj 456 text4a

file2
col1 col2 col3 col4
abc 123 text1
def 456 text2
def 789 text3
ghj 456 text4

after i combine them i am trying to
1. if data in col1 and col2 are the same then take data in col3 (was from
file2) and replace it into col3 of file 1.
2.then delete that row (ie the row originally from file2)
end result like this
file 1
col1 col2 col3 col4
abc 123 text1 text1a
def 456 text2 text2a
def 789 text3 text3a
ghj 456 text4 text4a

hope that makes sense.
--
cciissqq11
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

How about just retrieving the info from file2 and putting it in column 3?

=INDEX(Sheet2!$C$1:$C$100,
MATCH(1,((Sheet2!$A$1:$A$100=A1)*(Sheet2!$B$1:$B$1 00=B1)),0))

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

And adjust the range to match your data--but don't use the whole column.


Convert the formulas to values by:
Select column C
edit|copy
edit|paste special|values

Replace the errors (#N/A's) with empty cells.
Edit|replace
what: #n/a
with: (leave blank)
replace all



cisq1 wrote:

hi , i have 2 x files
file 1
col1 col2 col3 col4
abc 123 text1a
def 456 text2a
def 789 text3a
ghj 456 text4a

file2
col1 col2 col3 col4
abc 123 text1
def 456 text2
def 789 text3
ghj 456 text4

after i combine them i am trying to
1. if data in col1 and col2 are the same then take data in col3 (was from
file2) and replace it into col3 of file 1.
2.then delete that row (ie the row originally from file2)
end result like this
file 1
col1 col2 col3 col4
abc 123 text1 text1a
def 456 text2 text2a
def 789 text3 text3a
ghj 456 text4 text4a

hope that makes sense.
--
cciissqq11


--

Dave Peterson
  #3   Report Post  
cisq1
 
Posts: n/a
Default

give me a couple of days to try this out ..
--
cciissqq11


"Dave Peterson" wrote:

How about just retrieving the info from file2 and putting it in column 3?

=INDEX(Sheet2!$C$1:$C$100,
MATCH(1,((Sheet2!$A$1:$A$100=A1)*(Sheet2!$B$1:$B$1 00=B1)),0))

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

And adjust the range to match your data--but don't use the whole column.


Convert the formulas to values by:
Select column C
edit|copy
edit|paste special|values

Replace the errors (#N/A's) with empty cells.
Edit|replace
what: #n/a
with: (leave blank)
replace all



cisq1 wrote:

hi , i have 2 x files
file 1
col1 col2 col3 col4
abc 123 text1a
def 456 text2a
def 789 text3a
ghj 456 text4a

file2
col1 col2 col3 col4
abc 123 text1
def 456 text2
def 789 text3
ghj 456 text4

after i combine them i am trying to
1. if data in col1 and col2 are the same then take data in col3 (was from
file2) and replace it into col3 of file 1.
2.then delete that row (ie the row originally from file2)
end result like this
file 1
col1 col2 col3 col4
abc 123 text1 text1a
def 456 text2 text2a
def 789 text3 text3a
ghj 456 text4 text4a

hope that makes sense.
--
cciissqq11


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
find and replace steve Excel Discussion (Misc queries) 1 June 23rd 05 01:43 AM
Find and REPLACE within a selection, or column- not entire sheet/. smithers2002 Excel Worksheet Functions 4 April 21st 05 04:45 PM
Find and Replace - Quickest Option? Lindsey M Excel Worksheet Functions 1 March 8th 05 11:34 AM
find replace cursor default to find box luffa Excel Discussion (Misc queries) 0 February 3rd 05 12:11 AM
VB Find and Replace Bony_Pony Excel Worksheet Functions 10 December 6th 04 05:45 PM


All times are GMT +1. The time now is 07:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"