Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 91
Default Lookup for smallest number?

I have a table that contains hundreds of records listing bus route numbers
and the start time of each trip. What I want to do is look up a route number
in one column and because that route number is found in that column anywhere
from once to 60 times, return the smallest number in the time column for that
route. Example"

Route Time
521 0630
521 0735
521 0920
521 1015
521 1120
521 1215
521 1324
521 1420
521 1610
521 1905
521 2000
522 0530
522 0613
etc.

I want the lookup table to help isolate the operating time of the route
extracting the start time of 0630 because it is the smallest time for route
521 and 2000 for the last time the bus picks up passengers because it is the
largest time in the time column for route 521. Is this possible?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default Lookup for smallest number?

=MIN(IF($A$2:$A$1000=521,$B$2:$B$1000))

=MAX(IF($A$2:$A$1000=521,$B$2:$B$1000))

Enter both with Ctrl+Shift+Enter

HTH

"JICDB" wrote:

I have a table that contains hundreds of records listing bus route numbers
and the start time of each trip. What I want to do is look up a route number
in one column and because that route number is found in that column anywhere
from once to 60 times, return the smallest number in the time column for that
route. Example"

Route Time
521 0630
521 0735
521 0920
521 1015
521 1120
521 1215
521 1324
521 1420
521 1610
521 1905
521 2000
522 0530
522 0613
etc.

I want the lookup table to help isolate the operating time of the route
extracting the start time of 0630 because it is the smallest time for route
521 and 2000 for the last time the bus picks up passengers because it is the
largest time in the time column for route 521. Is this possible?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Lookup for smallest number?

On Mon, 30 Jul 2007 07:44:02 -0700, JICDB
wrote:

I have a table that contains hundreds of records listing bus route numbers
and the start time of each trip. What I want to do is look up a route number
in one column and because that route number is found in that column anywhere
from once to 60 times, return the smallest number in the time column for that
route. Example"

Route Time
521 0630
521 0735
521 0920
521 1015
521 1120
521 1215
521 1324
521 1420
521 1610
521 1905
521 2000
522 0530
522 0613
etc.

I want the lookup table to help isolate the operating time of the route
extracting the start time of 0630 because it is the smallest time for route
521 and 2000 for the last time the bus picks up passengers because it is the
largest time in the time column for route 521. Is this possible?


Assume your columns are named "Route" and "Time"

E3: Route number of interest

Use the **array** formulas:

=MAX(IF(Route=E3,Time,""))
=MAX(IF(Route=E3,Time,""))

To enter an **array** formula, hold down <ctrl<shift while hitting <enter.
Excel will place braces {...} around the formula.
--ron
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 57
Default Lookup for smallest number?

Hi

With the data in columns A and B, I entered 521 in cell C2.
The following array formula will give the earliest and latest times
Earliest
{=MIN(IF(A2:A14=C2,B2:B14))}
Latest
{=MAX(IF(A2:A14=C2,B2:B14))}

Array formulae must be Entered or Amended using Control + Shift + Enter
(CSE) not just Enter.
When you use CSE, Excel will insert the curly braces { } for you. Do not
type them yourself.
--
Regards
Roger Govier



"JICDB" wrote in message
...
I have a table that contains hundreds of records listing bus route numbers
and the start time of each trip. What I want to do is look up a route
number
in one column and because that route number is found in that column
anywhere
from once to 60 times, return the smallest number in the time column for
that
route. Example"

Route Time
521 0630
521 0735
521 0920
521 1015
521 1120
521 1215
521 1324
521 1420
521 1610
521 1905
521 2000
522 0530
522 0613
etc.

I want the lookup table to help isolate the operating time of the route
extracting the start time of 0630 because it is the smallest time for
route
521 and 2000 for the last time the bus picks up passengers because it is
the
largest time in the time column for route 521. Is this possible?



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Lookup for smallest number?

Another quick alternative is to use a pivot table (PT). In a matter of
seconds, the PT can provide both the required uniques listing of the Routes
and the corresponding Min & Max "Time" values

First, ensure that all the "Time" values are converted to real numbers.
Select an empty cell, then right-click on the Time col Paste special Add
OK.


Then select any cell within the source table
Click Data PivotTable .. Click Next Next.
In step 3 of the wizard, click Layout.
Drag n drop Route within the ROW area.
Drag n drop Time within the DATA area twice, one below the other.
It'll appear as "Sum of Time/Time2". Double click on the 1st, choose "Min"
under Summarize by, change the name/label to say, "1st bus", click OK. Double
click on the 2nd, choose "Max" under Summarize by, change the label to say,
"Last bus", click OK. Click OK Finish.

Hop over to the PT sheet. Just drag n drop Data onto "Total", and you would
have the required results as per sample below (Just ignore or hide away the
bottom "Grand Total" line):

..........Data
Route 1st bus Last bus
521 630 2000
522 530 xxxx
etc
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"JICDB" wrote:
I have a table that contains hundreds of records listing bus route numbers
and the start time of each trip. What I want to do is look up a route number
in one column and because that route number is found in that column anywhere
from once to 60 times, return the smallest number in the time column for that
route. Example"

Route Time
521 0630
521 0735
521 0920
521 1015
521 1120
521 1215
521 1324
521 1420
521 1610
521 1905
521 2000
522 0530
522 0613
etc.

I want the lookup table to help isolate the operating time of the route
extracting the start time of 0630 because it is the smallest time for route
521 and 2000 for the last time the bus picks up passengers because it is the
largest time in the time column for route 521. Is this possible?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Lookup for smallest number?

Morn', just housekeeping here <g ..

Line:
Select an empty cell, then right-click on the Time col ..


should have read as:
Copy an empty cell, then right-click on the Time col ..


The step above is not necessary if the Time col already contains real
numbers
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Lookup for smallest number?

=MIN(IF(A2:A14=521,B2:B14))
--
David Biddulph

"JICDB" wrote in message
...
I have a table that contains hundreds of records listing bus route numbers
and the start time of each trip. What I want to do is look up a route
number
in one column and because that route number is found in that column
anywhere
from once to 60 times, return the smallest number in the time column for
that
route. Example"

Route Time
521 0630
521 0735
521 0920
521 1015
521 1120
521 1215
521 1324
521 1420
521 1610
521 1905
521 2000
522 0530
522 0613
etc.

I want the lookup table to help isolate the operating time of the route
extracting the start time of 0630 because it is the smallest time for
route
521 and 2000 for the last time the bus picks up passengers because it is
the
largest time in the time column for route 521. Is this possible?



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 91
Default Lookup for smallest number?

You guys are awesome! Thanks. I'll try all of them and see which works
best. Thanks again.

Patti

"David Biddulph" wrote:

=MIN(IF(A2:A14=521,B2:B14))
--
David Biddulph

"JICDB" wrote in message
...
I have a table that contains hundreds of records listing bus route numbers
and the start time of each trip. What I want to do is look up a route
number
in one column and because that route number is found in that column
anywhere
from once to 60 times, return the smallest number in the time column for
that
route. Example"

Route Time
521 0630
521 0735
521 0920
521 1015
521 1120
521 1215
521 1324
521 1420
521 1610
521 1905
521 2000
522 0530
522 0613
etc.

I want the lookup table to help isolate the operating time of the route
extracting the start time of 0630 because it is the smallest time for
route
521 and 2000 for the last time the bus picks up passengers because it is
the
largest time in the time column for route 521. Is this possible?




  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 806
Default Lookup for smallest number?

Hello,

If your data is sorted (as you show it):
Route First Last
521 =INDEX(Source!B:B,MATCH(A2,Source!A:A,)) =LOOKUP(2,1/(A2=Source!
A:A),Source!B:B)
522 =INDEX(Source!B:B,MATCH(A3,Source!A:A,)) =LOOKUP(2,1/(A3=Source!
A:A),Source!B:B)
....

Regards,
Bernd

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
Lookup Based on Next Smallest Number M Moore Excel Discussion (Misc queries) 1 October 23rd 06 05:14 AM
Looking for the smallest number that isn't less than zero CharlieS Excel Worksheet Functions 3 October 2nd 06 04:03 PM
RETREIVING THE SMALLEST NUMBER ashaback Excel Worksheet Functions 1 July 28th 06 03:21 PM
smallest missing number Chris_t_2k5 Excel Discussion (Misc queries) 6 February 16th 06 07:22 PM
How to highlight the smallest number other than zero Kenny New Users to Excel 1 January 14th 06 06:41 AM


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