+ Reply to Thread
Results 1 to 5 of 5

Excel formula to get the desired value from the table

  1. #1
    Registered User
    Join Date
    10-13-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2

    Excel formula to get the desired value from the table

    In the attached excel sheet, I need excel formula to get the results.

    In sheet1, I need the Destination (column B) and Price (column C) from the table

    In sheet2, In the Rate CELL (column D), I want the value from the below table. For example 1 in D2 cell, for Sydney-NSW3, the rate should come as 3.21
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Excel formula to get the desired value from the table

    welcome to the forum, nasirchaudhary.
    in Sheet1 B3:
    =MID(A3,FIND("- ",A3)+2,FIND(".",A3)-FIND("- ",A3)-2)

    C3:
    =MID(A3,FIND("$",A3)+1,SEARCH(" per ",A3)-FIND("$",A3)-1)+0

    in Sheet2 D2:
    =INDEX($B$11:$M$22,MATCH(TRIM(LEFT(B2,FIND("-",B2)-1)),$A$11:$A$22,0),MATCH(TRIM(MID(B2,FIND("-",B2)+1,LEN(B2))),$B$9:$M$9,0))
    D3 doesn't work because Albury in A12 has a space.

    good sample file by the way

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Excel formula to get the desired value from the table

    This works for the second question:

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    It takes into account inconsistent layout in the route field (spaces and hyphens) and also trailing spaces in the start and destination headers.

    You'd use similar formulae, with SUBSTITUTE, FIND, RIGHT, MID, etc., to get the various bits of the text you want from list.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    10-13-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Excel formula to get the desired value from the table

    Thank you..

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Excel formula to get the desired value from the table

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. [SOLVED] Can't get the desired summary (table, pivot table, ???)
    By jhren in forum Excel General
    Replies: 1
    Last Post: 05-24-2013, 07:33 AM
  2. Adding a sorting button to a table to sort as desired
    By mj_bowen in forum Excel General
    Replies: 1
    Last Post: 06-10-2012, 11:37 AM
  3. Replies: 0
    Last Post: 12-02-2011, 01:02 PM
  4. Replies: 0
    Last Post: 07-14-2011, 11:21 AM
  5. [SOLVED] Elegant Formula Help Desired
    By Lewis Clark in forum Excel General
    Replies: 4
    Last Post: 12-05-2005, 11:10 AM

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