+ Reply to Thread
Results 1 to 9 of 9

Vlookup and match functions

  1. #1
    Forum Contributor
    Join Date
    06-20-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    106

    Lightbulb Vlookup and match functions

    Hello,
    I need some help using the vlookup and match (maybe also the index function) with this excel problem I'm having. I also tried using a couter in my VBA code, but the counter stuff got really messy.

    Thank you in advance! Send me a direct message if you want to see the excel file. Sorry about the formatting.


    =VLOOKUP($AH7,AH6:AH504,MATCH(AK$4,$AK4:$AK21,0),FALSE)& VLOOKUP(AI6,AI$6:AI$504,MATCH(AN3,AN3,0),FALSE)&VLOOKUP(AJ7,AJ$6:AJ$504, MATCH(AN3,AN3,0),FALSE)


    Avg X Y Z
    172 54 02 1
    74 54 02 3
    168 54 03 1
    78 54 03 3


    Therefore I want to find the value 74 (avg) and put it in this position, and so forth from the x, y, z coordinates to give the avg. My spreadsheet has 504 rows and 49 columns. I want to either use vlookup and match functions, or I need help writing some VBA code.

    blank blank 1 2 3
    54 3 blank 74 78
    54 2 blank blank blank
    54 1 blank blank 168

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Vlookup and match functions

    Hello and welcome to the forum.

    You need to find out the average OR you need to arrange the data as per your second table ? Would be more helpful if you upload a sample workbook. Thanks.

    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Forum Contributor
    Join Date
    06-20-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    106

    Lightbulb Re: Vlookup and match functions

    selected data for avg matching.xlsm

    Here is my file. I have written some VBA code and my comments are in there as well. I took one VBA class in college, so I'm fairly new to this program. If you have any more questions please reply to my post!!

  4. #4
    Forum Contributor
    Join Date
    06-20-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    106

    Post Re: Vlookup and match functions

    average vlookup.docx

    I have attached another file, this is an example of what I want the code to do.

    To clarify, the spot for 74 is coordinates x=54, y = 2 and z =3. I manually filled in some other averages to show you how I want my spreadsheet to look when I have the code figured out.

    Thank you!

  5. #5
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Vlookup and match functions

    Okay.. you can use below formula (entered as ctrl shift enter)

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


    selected data for avg matching.xlsm

    Regards,
    DILIPandey
    <click on below * if this helps>

  6. #6
    Forum Contributor
    Join Date
    06-20-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    106

    Re: Vlookup and match functions

    That was really helpful! That's exactly what I wanted my code to do. One more question...you added some code to the RibbonX VBA section.

    Can you explain what this does-->

    'Entry point for RibbonX button click
    Sub ShowATPDialog(control As IRibbonControl)
    Application.Run ("fDialog")
    End Sub

    'Callback for RibbonX button label
    Sub GetATPLabel(control As IRibbonControl, ByRef label)
    label = ThisWorkbook.Sheets("RES").Range("A10").Value
    End Sub

  7. #7
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Vlookup and match functions

    Hey.. I did not used any code.
    All results are getting fetched using formula only



    Regards,
    DILIPandey
    <click on below * if this helps>

  8. #8
    Forum Contributor
    Join Date
    06-20-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    106

    Re: Vlookup and match functions

    That RibbonX code was generated by my Command Button that I was using in my VBA code. Now I see that all your results were fetched from the IfError function and Index function and Match function. I will mark this thread as solved. Thanks again!

  9. #9
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Vlookup and match functions

    Cheers


    You are welcome ...


    Regards,
    DILIPandey
    <click on below * if this helps>

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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