+ Reply to Thread
Results 1 to 3 of 3

Finding the larger of a set and returning the value (city)

  1. #1
    Registered User
    Join Date
    10-04-2016
    Location
    Saint Louis, MO
    MS-Off Ver
    2013
    Posts
    37

    Finding the larger of a set and returning the value (city)

    I am trying to have the last or largest number return me the destination city?

    In the following set, Fort Worth is attached to H382826-4. I am needing Fort Worth to be next to H382826-1. I have already done the Origin part but that was easy. This has me a bit stumped.

    Any advise would be greatly appreciated.

    H382826-1
    H382826-2
    H382826-3
    H382826-4


    I would need something that can look for and up to 8 - 10 stops. Each one of the numbers past the " - " is a dispatch to another driver.


    Capture.JPG

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2505
    Posts
    13,754

    Re: Finding the larger of a set and returning the value (city)

    Try this in C1 and fill down.

    =IF(--RIGHT(A1,1)>1,"",LOOKUP(2,1/(LEFT($A$1:$A$12,7)=LEFT(A1,7)),$B$1:$B$12))


    A
    B
    C
    1
    H382826-1
    HOUSTON
    FORT WORTH
    2
    H382826-2
    HOUSTON
    3
    H382826-3
    DALLAS
    4
    H382826-4
    FORT WORTH
    5
    H666552-1
    HOUSTON
    FORT WORTH
    6
    H666552-2
    HOUSTON
    7
    H666552-3
    HOUSTON
    8
    H666552-4
    HOUSTON
    9
    H666552-5
    HOUSTON
    10
    H666552-6
    HOUSTON
    11
    H666552-7
    DALLAS
    12
    H666552-8
    FORT WORTH


    If this doesn't do what you want please upload an Excel workbook. Screenshots aren't of much help and we don't have to re-type the data.
    You'll also get more and faster response.
    Dave

  3. #3
    Registered User
    Join Date
    01-20-2017
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    199

    Re: Finding the larger of a set and returning the value (city)

    I agree with Dave. An attached file also gives us a chance to test out the formulas and macros.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. finding the closest smaller and larger values in a list
    By bachree in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-28-2014, 02:42 PM
  2. Calculating Shipment Rates Base on Origin City and Destination City
    By Chnatko in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-09-2014, 11:11 AM
  3. Returning the larger of two values in a separate box
    By davidingilbert in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-26-2013, 12:14 PM
  4. Calculating City to City -road miles
    By williesmith2008 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-22-2012, 05:19 AM
  5. extract city using city list lookup
    By terrysoper1973 in forum Excel General
    Replies: 1
    Last Post: 09-07-2011, 01:43 PM
  6. Finding the larger of 2 values in a query
    By jik_ff in forum Access Tables & Databases
    Replies: 8
    Last Post: 08-22-2011, 07:11 AM
  7. returning the value of the larger cell
    By stephen1000 in forum Excel General
    Replies: 2
    Last Post: 02-05-2009, 05:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1