Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
scr scr is offline
external usenet poster
 
Posts: 10
Default Replacing information from one worksheet to another if conditions

I have an original list of addresses. A "reroute" list is provided. If
columns A, B, & C on the original list match columns A, B, & C on the
"reroute" list the addresses in columns D, E, F, G & H must be changed to
the new addresses listed on the "reroute" list columns D, E, F, G & H.

If, however, there is not match then the address in the original list needs
to stay the same.

Any suggestions?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,073
Default Replacing information from one worksheet to another if conditions

On Sep 29, 8:16*am, scr wrote:
I have an original list of addresses. *A "reroute" list is provided. *If
columns A, B, & C on the original list *match columns A, B, & C on the
"reroute" list the addresses in columns *D, E, F, G & H must be changed to
the new addresses listed on the "reroute" list columns D, E, F, G & H. *

If, however, there is not match then the address in the original list needs
to stay the same.

Any suggestions?


One way...
In I2 on the sheet with the original list of addresses...
=IF(SUMPRODUCT(--(Sheet2!$A$2:$A$11=$A2),--(Sheet2!$B$2:$B$11=$B2),--
(Sheet2!$C$2:$C$11=$C2))=0,D2,SUMPRODUCT(--(Sheet2!$A$2:$A$11=$A2),--
(Sheet2!$B$2:$B$11=$B2),--(Sheet2!$C$2:$C$11=$C2),Sheet2!D$2:D$11))

Fill across to M2 then down to the bottom of list of original
addresses.
Then hide the columns D to H of original addresses.

As is formula works for maximum of 10 reroutes on a sheet named
Sheet2.

Edit the formula to suit the number of reroutes and the reroute sheet
name.

Ken Johnson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,389
Default Replacing information from one worksheet to another if conditions

Any suggestions?

Check your other posts for answers.

Regards,
Fre.


"scr" wrote in message
...
I have an original list of addresses. A "reroute" list is provided. If
columns A, B, & C on the original list match columns A, B, & C on the
"reroute" list the addresses in columns D, E, F, G & H must be changed to
the new addresses listed on the "reroute" list columns D, E, F, G & H.

If, however, there is not match then the address in the original list
needs
to stay the same.

Any suggestions?


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
scr scr is offline
external usenet poster
 
Posts: 10
Default Replacing information from one worksheet to another if conditi

Hi Ken,

I tried you formula, it worked for some but not for all -- I got some #Value
errors. Cany you explain what your formula actually does in lay mans terms?
Maybe it will help me understand it better.

"Ken Johnson" wrote:

On Sep 29, 8:16 am, scr wrote:
I have an original list of addresses. A "reroute" list is provided. If
columns A, B, & C on the original list match columns A, B, & C on the
"reroute" list the addresses in columns D, E, F, G & H must be changed to
the new addresses listed on the "reroute" list columns D, E, F, G & H.

If, however, there is not match then the address in the original list needs
to stay the same.

Any suggestions?


One way...
In I2 on the sheet with the original list of addresses...
=IF(SUMPRODUCT(--(Sheet2!$A$2:$A$11=$A2),--(Sheet2!$B$2:$B$11=$B2),--
(Sheet2!$C$2:$C$11=$C2))=0,D2,SUMPRODUCT(--(Sheet2!$A$2:$A$11=$A2),--
(Sheet2!$B$2:$B$11=$B2),--(Sheet2!$C$2:$C$11=$C2),Sheet2!D$2:D$11))

Fill across to M2 then down to the bottom of list of original
addresses.
Then hide the columns D to H of original addresses.

As is formula works for maximum of 10 reroutes on a sheet named
Sheet2.

Edit the formula to suit the number of reroutes and the reroute sheet
name.

Ken Johnson

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,073
Default Replacing information from one worksheet to another if conditi

On Sep 30, 9:13*am, scr wrote:
Hi Ken,

I tried you formula, it worked for some but not for all -- I got some #Value
errors. *Cany you explain what your formula actually does in lay mans terms? *
Maybe it will help me understand it better.

"Ken Johnson" wrote:
On Sep 29, 8:16 am, scr wrote:
I have an original list of addresses. *A "reroute" list is provided.. *If
columns A, B, & C on the original list *match columns A, B, & C on the
"reroute" list the addresses in columns *D, E, F, G & H must be changed to
the new addresses listed on the "reroute" list columns D, E, F, G & H.. *


If, however, there is not match then the address in the original list needs
to stay the same.


Any suggestions?


One way...
In I2 on the sheet with the original list of addresses...
=IF(SUMPRODUCT(--(Sheet2!$A$2:$A$11=$A2),--(Sheet2!$B$2:$B$11=$B2),--
(Sheet2!$C$2:$C$11=$C2))=0,D2,SUMPRODUCT(--(Sheet2!$A$2:$A$11=$A2),--
(Sheet2!$B$2:$B$11=$B2),--(Sheet2!$C$2:$C$11=$C2),Sheet2!D$2:D$11))


Fill across to M2 then down to the bottom of list of original
addresses.
Then hide the columns D to H of original addresses.


As is formula works for maximum of 10 reroutes on a sheet named
Sheet2.


Edit the formula to suit the number of reroutes and the reroute sheet
name.


Ken Johnson


Hi scr,

I must retract my suggestion!
It only works with numbers.

Ken Johnson


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,073
Default Replacing information from one worksheet to another if conditi

Hi scr,

For Text and Numbers use...

=IF(SUMPRODUCT(--(Sheet2!$A$2:$A$11=$A2),--(Sheet2!$B$2:$B$11=$B2),--
(Sheet2!$C$2:$C$11=$C2))<0,OFFSET(Sheet2!$A$1,SUM PRODUCT(--(Sheet2!$A
$2:$A$11=$A2),--(Sheet2!$B$2:$B$11=$B2),--(Sheet2!$C$2:$C$11=
$C2),ROW(Sheet2!D$2:D$11))-1,COLUMNS($A:C)),D2)

It's an IF function.
The condition being tested can be expressed as...
"Are the values on this row in columns A, B and C the same as the
corresponding values in any of the rows of the sheet with the reroute
data?
eg On this row A="John",B="Smith" and C="Teacher". Is there a row on
the reroute sheet where A="John",B="Smith" and C="Teacher"?
This test is carried out by...
SUMPRODUCT(--(Sheet2!$A$2:$A$11=$A2),--(Sheet2!$B$2:$B$11=$B2),--
(Sheet2!$C$2:$C$11=$C2)<0

When the result of the test is TRUE the SUMPRODUCT function...
SUMPRODUCT(--(Sheet2!$A$2:$A$11=$A2),--(Sheet2!$B$2:$B$11=$B2),--
(Sheet2!$C$2:$C$11=$C2),ROW(Sheet2!D$2:D$11))
tells the OFFSET function which row on the reroute sheet has columns
A, B and C the same as those on the row with the formula.
The OFFSET function is anchored at Sheet2!$A$1 and it returns the
value on the reroute sheet on the row with the same A,B and C values
(the row offset argument is 1 less than the actual row where the
correct values were located by the SUMPRODUCT function).
The column offset argument is given by...

COLUMNS($A:C)

increments to COLUMNS($A:D) then COLUMNS($A:E) etc as the formula is
filled across the five columns so that the different reroute columns
are referred to.
COLUMNS($A:C)=3
COLUMNS($A:D)=4
COLUMNS($A:E)=5 etc

When the result of the test is FALSE the original data in column D is
returned. As the formula is filled across to the other 4 columns this
changes to E, F, G then H.

See...
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

for excellent explanation of the SUMPRODUCT function

Ken Johnson
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
replacing value in formula from outside worksheet? Mike[_4_] Excel Discussion (Misc queries) 4 March 24th 08 10:17 PM
Replacing a corrupt worksheet Steve Excel Worksheet Functions 0 September 17th 07 11:20 PM
Looking up a variable in one worksheet and copying information from another column to another worksheet?? Brad Torken Excel Discussion (Misc queries) 2 December 10th 06 06:02 AM
Using information from one worksheet, to rename inserted worksheet Lyn Excel Worksheet Functions 0 March 24th 06 12:54 AM
Can I sync information on one worksheet with another worksheet Eileen Excel Worksheet Functions 2 August 2nd 05 01:41 PM


All times are GMT +1. The time now is 10:38 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"