+ Reply to Thread
Results 1 to 8 of 8

use 2 values on sheet 1 to search sheet 2 & return text on sheet 1

  1. #1
    Registered User
    Join Date
    01-20-2013
    Location
    shelter island, ny
    MS-Off Ver
    Excel 2007
    Posts
    9

    use 2 values on sheet 1 to search sheet 2 & return text on sheet 1

    2-1 AD test.xlsm
    Need to fill in sheet 1 col P (CODE#) and col Q (COST)
    use sheet 1 col V value & col W value
    to search sheet 2, and return text for sheet 1 col P
    sheet 1 col V must match sheet 2 col E
    sheet 1 col W value must be >= sheet 2 col F & <= col G.

    I thought I could use 2 formulas
    COST col Q =VLOOKUP(P2,'code list'!H:I,2,FALSE)

    I know the VLOOKUP will give me col W (the price) but col V (the term)isn't unique on sheet 2
    I think I've got multiple problems, and I think maybe I need to use MATCH for col V
    I need the formula to return the 'CODE#' from sheet 2.
    I've tried multiple variations with this:
    =_______(AND(W2>=VLOOKUP(V2,'code list'!E:F,2,FALSE),W2<=VLOOKUP(V2,'code list'!E:G,3,FALSE)),_______)

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: use 2 values on sheet 1 to search sheet 2 & return text on sheet 1

    post self-deleted
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    01-20-2013
    Location
    shelter island, ny
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: use 2 values on sheet 1 to search sheet 2 & return text on sheet 1

    how do i fix that, didn't mean to delete the post

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: use 2 values on sheet 1 to search sheet 2 & return text on sheet 1

    Looking at your sample file, are you sure the answer for the 1st row is 21? from the table on sheet2, 48 and 1300 looks to me like it should return 59?

    edit:
    how do i fix that, didn't mean to delete the post
    sorry for the confusion, I deleted my own post there, it was nothing you did

  5. #5
    Registered User
    Join Date
    01-20-2013
    Location
    shelter island, ny
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: use 2 values on sheet 1 to search sheet 2 & return text on sheet 1

    sorry, I was just typing in any code (col P) to test the formula in col Q, forgot to delete it.

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: use 2 values on sheet 1 to search sheet 2 & return text on sheet 1

    I think you should use sth like this:
    In P2:
    Please Login or Register  to view this content.
    Confirmed by holding both Ctrl-Shift, then Enter.
    Drag down and copy to Cost column
    Quang PT

  7. #7
    Registered User
    Join Date
    01-20-2013
    Location
    shelter island, ny
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: use 2 values on sheet 1 to search sheet 2 & return text on sheet 1

    thank you,
    index/match = much appreciated.
    sitting here going through your formula, learned more from your formula than I did searching match/index on line for 4 hrs.
    bye-bye vlookup, hello, index, match.
    So, not only have you saved me many hrs, processing these sheets; I think you've given me a way to adjust other vlookup formulas I've been using on other sheets.

    I'm going to start calling this site 'browes & learn'

    thanks you

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: use 2 values on sheet 1 to search sheet 2 & return text on sheet 1

    Blake, vlookup still has it's place, so dont throw it way just yet lol. Although index/match is far more powerful and flexible, I still use vlookup fequently, expecially for quick-n-easy searches.

    Also, you can even combine the 2 together using vlookup inside index/with-or-without-match

    But this is definitely an awesome site to learn from, and it has a great bunch of people that are all willing to offer help and suggestions - glad to have you aboard

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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