#1   Report Post  
Louis
 
Posts: n/a
Default Merging new data

I have a master worksheet (WS1), and a new worksheet (WS2) with updated
pricing on about 3K items. I need to put the new pricing from WS2 for each
item into WS1. Not all items have new pricing, so if there is no change, or
the item isn't even listed in WS2, then I need the old price to be left as it
is. I am only concerned with 2 columns of data, Column A being product #,
and Column B being Price.
Simply put, I want excel to look at product A on WS2, and if that product is
on WS1, then I want to update WS1 with the new price.
It would also be very nice if when product A on WS2 was not recognized it
was highlighted or put into a new column or something, since I will need to
add those new items eventually. But most important I need to update pricing
on these items.

--
Louis
  #2   Report Post  
David Benson
 
Posts: n/a
Default

Louis,

Let's assume that in worksheet WS1, you have labels in Row 1, and your data
starts in Row 2. In Cell C2 of worksheet WS1, enter the following formula:

=if(iserror(match(a2,ws2!$a$1:$a$5000,0)),b2,index (ws2!$b$1:$b$5000,match(a2,ws2!$a$1:$a$5000,0),1))

Copy this formula down as many rows as you have data for in worksheet WS1.
Make sure that the workbook has been completely calculated, then copy the
prices from Column C of WS1 and do a Paste Special Values into Column B.

Here's what the formula does:

match(a2,ws2!$a$1:$a$5000,0) - Looks in Column A of WS2 to see the the
Product # in Cell A2 appears. If it does appear, the function returns the
row # in which it appears. If it doesn't appear, the function returns the
#REF! error.

iserror(...) - If the "match" function above returns the #REF! error, it
would normally result in the formula as a whole returning the same error.
The "iserror" function prevents that - it returns "TRUE" if the "match"
function returns an error, thereby allowing you to test for the error
condition without being overcome by it.

index(ws2!$b$1:$b$5000,match(...),1) - Now that we know that the Product #
in Cell A2 appears in worksheet WS2, we use the "match" function a second
time to tell the "index" function where to the find the corresponding new
price from column B.

Good luck!

-- David B

"Louis" WS2 for each
item into WS1. Not all items have new pricing, so if there isoft.com
wrote in message
...
I have a master worksheet (WS1), and a new worksheet (WS2) with updated
pricing on about 3K items. I need to put the new pricing no change, or
the item isn't even listed in WS2, then I need the old price to be left as
it
is. I am only concerned with 2 columns of data, Column A being product #,
and Column B being Price.
Simply put, I want excel to look at product A on WS2, and if that product
is
on WS1, then I want to update WS1 with the new price.
It would also be very nice if when product A on WS2 was not recognized it
was highlighted or put into a new column or something, since I will need
to
add those new items eventually. But most important I need to update
pricing
on these items.

--
Louis



  #3   Report Post  
Louis
 
Posts: n/a
Default

Great, what a massive help. I had to make a few tweaks (my worksheets were
named something different and there were other columns in between the actual
two that mattered) but they were easy to figure out.
Thank you again.
--
Louis


"David Benson" wrote:

Louis,

Let's assume that in worksheet WS1, you have labels in Row 1, and your data
starts in Row 2. In Cell C2 of worksheet WS1, enter the following formula:

=if(iserror(match(a2,ws2!$a$1:$a$5000,0)),b2,index (ws2!$b$1:$b$5000,match(a2,ws2!$a$1:$a$5000,0),1))

Copy this formula down as many rows as you have data for in worksheet WS1.
Make sure that the workbook has been completely calculated, then copy the
prices from Column C of WS1 and do a Paste Special Values into Column B.

Here's what the formula does:

match(a2,ws2!$a$1:$a$5000,0) - Looks in Column A of WS2 to see the the
Product # in Cell A2 appears. If it does appear, the function returns the
row # in which it appears. If it doesn't appear, the function returns the
#REF! error.

iserror(...) - If the "match" function above returns the #REF! error, it
would normally result in the formula as a whole returning the same error.
The "iserror" function prevents that - it returns "TRUE" if the "match"
function returns an error, thereby allowing you to test for the error
condition without being overcome by it.

index(ws2!$b$1:$b$5000,match(...),1) - Now that we know that the Product #
in Cell A2 appears in worksheet WS2, we use the "match" function a second
time to tell the "index" function where to the find the corresponding new
price from column B.

Good luck!

-- David B

"Louis" WS2 for each
item into WS1. Not all items have new pricing, so if there isoft.com
wrote in message
...
I have a master worksheet (WS1), and a new worksheet (WS2) with updated
pricing on about 3K items. I need to put the new pricing no change, or
the item isn't even listed in WS2, then I need the old price to be left as
it
is. I am only concerned with 2 columns of data, Column A being product #,
and Column B being Price.
Simply put, I want excel to look at product A on WS2, and if that product
is
on WS1, then I want to update WS1 with the new price.
It would also be very nice if when product A on WS2 was not recognized it
was highlighted or put into a new column or something, since I will need
to
add those new items eventually. But most important I need to update
pricing
on these items.

--
Louis




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
Saving data in a worksheet within a workbook Homeuser Excel Discussion (Misc queries) 2 August 21st 05 10:49 PM
Merging data to one cell from many Pete Excel Discussion (Misc queries) 4 June 29th 05 01:43 AM
Merging data Eric Stephens Excel Discussion (Misc queries) 1 June 7th 05 07:14 PM
Merging data Eric Stephens Excel Discussion (Misc queries) 0 June 7th 05 06:35 PM
Running Data Table using an input that triggers DDE linked data [email protected] Excel Discussion (Misc queries) 1 December 16th 04 11:56 AM


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