Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dennis
 
Posts: n/a
Default Drop 3 Lowest Entries

I have a list in B2 thru B11 which includes in this order.... 15 10 48 16 27
8 2 21 10 60

What I woujld like to do is highlight the range and have the 3 lowest numbers
deleted, but I dont want them sorted first, the remaining 7 must stay in the
original cells. Here's where it gets tricky, because 10 is one of the lowest 3
and there are 2 10's, I want to keep one of the 10's (it doesn't matter which
one). So after all is done I would be left with 15 48 16 27 21 10 60

TIA, Dennis
================
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Hi Dennis,

Try this

Sub test()
Dim rng As Range
Dim iRow As Long
Dim i As Long

Set rng = Selection
For i = 1 To 3
iRow = Application.Match(Application.Small(rng, 1), rng, 0)
Cells(iRow, rng.Column).EntireRow.Delete
Next i

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Dennis" wrote in message
m...
I have a list in B2 thru B11 which includes in this order.... 15 10 48 16

27
8 2 21 10 60

What I woujld like to do is highlight the range and have the 3 lowest

numbers
deleted, but I dont want them sorted first, the remaining 7 must stay in

the
original cells. Here's where it gets tricky, because 10 is one of the

lowest 3
and there are 2 10's, I want to keep one of the 10's (it doesn't matter

which
one). So after all is done I would be left with 15 48 16 27 21 10

60

TIA, Dennis
================



  #3   Report Post  
Dennis
 
Posts: n/a
Default

Thanx Bob!! That works great for for getting rid of the three lowest entries.
What I need it to do tho is just delete the 3 entries out of the cells they
are in and leave all the rows intact. This is a great start for me tho, I'm
thinking I might need helper cells?

Thanx for the quick response Bob!!!

Dennis
=============


In article , "Bob Phillips"
wrote:
Hi Dennis,

Try this

Sub test()
Dim rng As Range
Dim iRow As Long
Dim i As Long

Set rng = Selection
For i = 1 To 3
iRow = Application.Match(Application.Small(rng, 1), rng, 0)
Cells(iRow, rng.Column).EntireRow.Delete
Next i

End Sub


  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

Hi Dennis,

How about this then, no helper cells

Sub test()
Dim rng As Range
Dim iRow As Long
Dim i As Long

Set rng = Selection
For i = 1 To 3
iRow = Application.Match(Application.Small(rng, 1), rng, 0)
Cells(iRow, rng.Column).Delete Shift:=xlUp
Next i

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Dennis" wrote in message
m...
Thanx Bob!! That works great for for getting rid of the three lowest

entries.
What I need it to do tho is just delete the 3 entries out of the cells

they
are in and leave all the rows intact. This is a great start for me tho,

I'm
thinking I might need helper cells?

Thanx for the quick response Bob!!!

Dennis
=============


In article , "Bob Phillips"
wrote:
Hi Dennis,

Try this

Sub test()
Dim rng As Range
Dim iRow As Long
Dim i As Long

Set rng = Selection
For i = 1 To 3
iRow = Application.Match(Application.Small(rng, 1), rng, 0)
Cells(iRow, rng.Column).EntireRow.Delete
Next i

End Sub




  #5   Report Post  
Dennis
 
Posts: n/a
Default

Thanx again Bob, works great!!!!!! Man you guys are good, and fast!

Dennis
==================



wrote:
Hi Dennis,

How about this then, no helper cells

Sub test()
Dim rng As Range
Dim iRow As Long
Dim i As Long

Set rng = Selection
For i = 1 To 3
iRow = Application.Match(Application.Small(rng, 1), rng, 0)
Cells(iRow, rng.Column).Delete Shift:=xlUp
Next i

End Sub




  #6   Report Post  
Jason Morin
 
Posts: n/a
Default

Try this in C2 and fill down:

=IF(AND(COUNTIF($B$2:B2,B2)<=1,OR(B2=SMALL($B$2:$B $11,
{1,2,3}))),"",B2)

HTH
Jason
Atlanta, GA

-----Original Message-----
I have a list in B2 thru B11 which includes in this

order.... 15 10 48 16 27
8 2 21 10 60

What I woujld like to do is highlight the range and have

the 3 lowest numbers
deleted, but I dont want them sorted first, the

remaining 7 must stay in the
original cells. Here's where it gets tricky, because 10

is one of the lowest 3
and there are 2 10's, I want to keep one of the 10's (it

doesn't matter which
one). So after all is done I would be left with 15 48

16 27 21 10 60

TIA, Dennis
================
.

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
automatic color change in cells using a drop down list kennethwt Excel Worksheet Functions 1 January 21st 05 06:37 PM
How do I drop the lowest 2 numbers and then average? nightlynik Excel Worksheet Functions 3 December 6th 04 09:10 PM
Filling drop down box Excel Worksheet Functions 3 November 26th 04 12:54 AM
Filling drop down box Nick Excel Discussion (Misc queries) 0 November 25th 04 07:49 PM
Drop List Referencing Boony Excel Worksheet Functions 2 November 11th 04 11:42 AM


All times are GMT +1. The time now is 08:48 AM.

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"