Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Sort by last update only - get rid of old ones

I have a very large worksheet that has multiple SKU's sorted by SKU then
Edition. I would like to get rid of the old Editions and just keep the
current one. On the exampe below, SKU 10E01254 has 3 editions I want to get
rid of 1 and 2 and keep the 3rd. all sku have multiple editions from 2 to 19
editions but I just one to keep on one spreadsheet the latest one on all SKU's
SKU Edition Price
10E01254 01 $850.00
10E01254 02 $850.00
10E01254 03 $840.00 Keep this

12L13567 01 $725.00
12L13567 02 $725.00
12L13567 03 $725.00
12L13567 04 $760.00
12L13567 05 $950.00 Keep this

12B01781 01 $160.00
12B01781 02 $180.00 Keep this

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,081
Default Sort by last update only - get rid of old ones

If you have MS Access, then import your data from Excel into Access. I put
your example data into an Access table named dbase.

Then create a blank query and go into SQL view. paste this query text and
run it

SELECT t1.sku, t1.edition, t1.price
FROM dbase t1 inner join
(
select sku, max(edition) as edition2 from dbase group by sku
) t2
on t1.sku = t2.sku and t1.edition = t2.edition2

export the results back to Excel

"Compare Values" wrote:

I have a very large worksheet that has multiple SKU's sorted by SKU then
Edition. I would like to get rid of the old Editions and just keep the
current one. On the exampe below, SKU 10E01254 has 3 editions I want to get
rid of 1 and 2 and keep the 3rd. all sku have multiple editions from 2 to 19
editions but I just one to keep on one spreadsheet the latest one on all SKU's
SKU Edition Price
10E01254 01 $850.00
10E01254 02 $850.00
10E01254 03 $840.00 Keep this

12L13567 01 $725.00
12L13567 02 $725.00
12L13567 03 $725.00
12L13567 04 $760.00
12L13567 05 $950.00 Keep this

12B01781 01 $160.00
12B01781 02 $180.00 Keep this

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Sort by last update only - get rid of old ones

Thank you so much. It helped

"Duke Carey" wrote:

If you have MS Access, then import your data from Excel into Access. I put
your example data into an Access table named dbase.

Then create a blank query and go into SQL view. paste this query text and
run it

SELECT t1.sku, t1.edition, t1.price
FROM dbase t1 inner join
(
select sku, max(edition) as edition2 from dbase group by sku
) t2
on t1.sku = t2.sku and t1.edition = t2.edition2

export the results back to Excel

"Compare Values" wrote:

I have a very large worksheet that has multiple SKU's sorted by SKU then
Edition. I would like to get rid of the old Editions and just keep the
current one. On the exampe below, SKU 10E01254 has 3 editions I want to get
rid of 1 and 2 and keep the 3rd. all sku have multiple editions from 2 to 19
editions but I just one to keep on one spreadsheet the latest one on all SKU's
SKU Edition Price
10E01254 01 $850.00
10E01254 02 $850.00
10E01254 03 $840.00 Keep this

12L13567 01 $725.00
12L13567 02 $725.00
12L13567 03 $725.00
12L13567 04 $760.00
12L13567 05 $950.00 Keep this

12B01781 01 $160.00
12B01781 02 $180.00 Keep this

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Sort by last update only - get rid of old ones

You could sort your data with a primary key of SKU number (ascending order) and
a secondary key of edition (but descending order)

So your data would look like:
10E01254 3 $840.00
10E01254 2 $850.00
10E01254 1 $850.00
12B01781 2 $180.00
12B01781 1 $160.00
12L13567 5 $950.00
12L13567 4 $760.00
12L13567 3 $725.00
12L13567 2 $725.00
12L13567 1 $725.00

Then in D1, put Keep (it's the first record that we want to keep)
In D2, put:
=if(a2=a1,"","Keep")
and drag down as far as you need.

Your test data looked like:
10E01254 3 $840.00 Keep
10E01254 2 $850.00
10E01254 1 $850.00
12B01781 2 $180.00 keep
12B01781 1 $160.00
12L13567 5 $950.00 keep
12L13567 4 $760.00
12L13567 3 $725.00
12L13567 2 $725.00
12L13567 1 $725.00

Then you can filter on column D to show the blanks and delete those visible
rows.

And then delete column D.



Compare Values wrote:

I have a very large worksheet that has multiple SKU's sorted by SKU then
Edition. I would like to get rid of the old Editions and just keep the
current one. On the exampe below, SKU 10E01254 has 3 editions I want to get
rid of 1 and 2 and keep the 3rd. all sku have multiple editions from 2 to 19
editions but I just one to keep on one spreadsheet the latest one on all SKU's
SKU Edition Price
10E01254 01 $850.00
10E01254 02 $850.00
10E01254 03 $840.00 Keep this

12L13567 01 $725.00
12L13567 02 $725.00
12L13567 03 $725.00
12L13567 04 $760.00
12L13567 05 $950.00 Keep this

12B01781 01 $160.00
12B01781 02 $180.00 Keep this


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Sort by last update only - get rid of old ones

Thank you so much it helped

"Dave Peterson" wrote:

You could sort your data with a primary key of SKU number (ascending order) and
a secondary key of edition (but descending order)

So your data would look like:
10E01254 3 $840.00
10E01254 2 $850.00
10E01254 1 $850.00
12B01781 2 $180.00
12B01781 1 $160.00
12L13567 5 $950.00
12L13567 4 $760.00
12L13567 3 $725.00
12L13567 2 $725.00
12L13567 1 $725.00

Then in D1, put Keep (it's the first record that we want to keep)
In D2, put:
=if(a2=a1,"","Keep")
and drag down as far as you need.

Your test data looked like:
10E01254 3 $840.00 Keep
10E01254 2 $850.00
10E01254 1 $850.00
12B01781 2 $180.00 keep
12B01781 1 $160.00
12L13567 5 $950.00 keep
12L13567 4 $760.00
12L13567 3 $725.00
12L13567 2 $725.00
12L13567 1 $725.00

Then you can filter on column D to show the blanks and delete those visible
rows.

And then delete column D.



Compare Values wrote:

I have a very large worksheet that has multiple SKU's sorted by SKU then
Edition. I would like to get rid of the old Editions and just keep the
current one. On the exampe below, SKU 10E01254 has 3 editions I want to get
rid of 1 and 2 and keep the 3rd. all sku have multiple editions from 2 to 19
editions but I just one to keep on one spreadsheet the latest one on all SKU's
SKU Edition Price
10E01254 01 $850.00
10E01254 02 $850.00
10E01254 03 $840.00 Keep this

12L13567 01 $725.00
12L13567 02 $725.00
12L13567 03 $725.00
12L13567 04 $760.00
12L13567 05 $950.00 Keep this

12B01781 01 $160.00
12B01781 02 $180.00 Keep this


--

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
Move - update - sort descending Gayle C[_2_] Excel Discussion (Misc queries) 10 June 11th 07 08:20 PM
Worksheet Reference Doesn't Update After Sort [email protected] Excel Worksheet Functions 1 March 9th 07 05:49 PM
i want to update one excel file the other one update automaticaly Basant New Users to Excel 1 December 16th 06 12:50 AM
League table automatic sort/update RedHook New Users to Excel 23 May 18th 06 02:44 PM
How to sort/update large excel db [email protected] Excel Discussion (Misc queries) 0 February 2nd 05 12:43 AM


All times are GMT +1. The time now is 11:14 PM.

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

About Us

"It's about Microsoft Excel"