+ Reply to Thread
Results 1 to 6 of 6

Fix Formula in Vlookup part

  1. #1
    Registered User
    Join Date
    11-17-2017
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    60

    Fix Formula in Vlookup part

    Hi All,

    This is something that I was working on yesterday and Jindon helped me with his code, so this is still based on his code. I was initially only after the max range, I thought now I would try it on the Vlookup part, but I am having trouble working this out. The “Set SCR = Range("B20:D20")” is to take into account the max column (B) and the two lookup columns (C and D). I have omitted the 2nd lookup code as it is basically the same as the 1st lookup part.

    I use similar code for other data so I am trying to set it up so that I only have to change the LastRow (LR), FirstCell (FR) and the Second Cell (SCR). Is it worth it, probably not, will it work, I don’t know but I thought I would give it a go anyway.



    This the max formula I get in “E6” when I run the code
    =MAX(B20:B500)

    This is what I get (WRONG) in cell “F6”
    =(VLOOKUP(MAX(B20:B500), B20:B500,2,FALSE))

    when it should be this - “B20:D500”
    =(VLOOKUP(MAX(B20:B500), B20:D500,2,FALSE))


    Please Login or Register  to view this content.

    Thanks
    Nat

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Fix Formula in Vlookup part

    Try change to
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-17-2017
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    60

    Re: Fix Formula in Vlookup part

    Thank you Jindon,

    I was close, but not close enough - I should have picked that up.

    Nat

  4. #4
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: Fix Formula in Vlookup part

    Hi
    Or may
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-17-2017
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    60

    Re: Fix Formula in Vlookup part

    Thanks mohadin, this works as well

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Fix Formula in Vlookup part

    Quote Originally Posted by NatalieW12 View Post
    Thanks mohadin, this works as well
    No, it is just an accidentally...
    should be
    Please Login or Register  to view this content.

+ 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] If Formula With VLookup & ISNA - PART II
    By Gtrtim112 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-24-2018, 10:10 AM
  2. [SOLVED] Need a Vlookup formula to search based on part of a cell
    By JesterGrafix in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-01-2018, 04:03 PM
  3. [SOLVED] VBA replace part of formula IF and VLOOKUP
    By Made in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-12-2016, 08:53 AM
  4. VLOOKUP formula only part of the Lookup_Value
    By dpratama in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 09-24-2014, 06:53 AM
  5. Displaying the date as part of a vlookup formula
    By john dalton in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-09-2013, 11:13 AM
  6. autopopulate part of VLOOKUP formula with data in another cell
    By kudell in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-22-2013, 11:40 AM
  7. Vlookup:get N/A for this part of the formula
    By legepe in forum Excel General
    Replies: 15
    Last Post: 03-14-2010, 04:35 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