+ Reply to Thread
Results 1 to 5 of 5

Vlookup with 2 criteria help

  1. #1
    Registered User
    Join Date
    10-23-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    2

    Vlookup with 2 criteria help

    Hi guys,

    I'm trying to create a lookup function in excel that will filter through 2 criteria.

    So I have attached my workbookBook1.xlsx

    What I need to do is create a function that will first filter it by the year, and then the annual period and return the value on column E based on that criteria. So if the year is 1, and annual period (column B) is 12, the returned value should be 13,585.

    I know i could make a concatenate to do this separately, but was wondering if there are any other method that could do it within 1 equation relying solely on the table provided.

    Thanks in advance!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Vlookup with 2 criteria help

    Hi,

    Try

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


    Incidentally most of us avoid merged cells like the plague, they just cause far too much trouble in all sorts of ways.
    It's not so important here since column A isn't being used in any calculation but be aware. Ideally you would have the year number in every row in column A although it seems somewhat redundant since you have actual dates.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    10-23-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    2

    Re: Vlookup with 2 criteria help

    Thank you for your reply.

    Could you explain to me the equation?

    I know what index does, but not sure I understand how you came up with the math equation there.

    Was it to take out the extra two rows at the top?

  4. #4
    Registered User
    Join Date
    01-24-2011
    Location
    South Carolina
    MS-Off Ver
    Excel 2007
    Posts
    74

    Re: Vlookup with 2 criteria help

    Also, I've used Vlookup and where you insert the column number, you use MATCH.

    Match works similarly to vlookup, MATCH(lookup value, lookup row), except it returns a column number in the row, not the value.


    I personally use one that is =VLOOKUP($A2, 'usage!' $A$2:$NV$290, MATCH(B$1,'usage!' $B$2:$NV$1)+1,FALSE)

    since Match returns the column number, and my Match starts in B instead of A, that '+1' at the end helps with alignment to get the correct data.
    < Click the * to say 'thanks'

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Vlookup with 2 criteria help

    Hi,

    The row number of each row is the same as your consecutively numbered monthly periods plus 2

    Hence all you need to do is identify the row number. Since there are always 12 periods in a year multiplying the number of years by 12 will give you a starting number. e.g. multiplying M4 x 12 when M4 = 1 gives 12. Now we deduct 10 to give us a start row for the year, i.e. row 2 and then add in the period number in the year (M5) and that gives us 14. Hence 14 is the index number for the row element of the INDEX() function.

+ 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. Large multi criteria / Vlookup/Choose Multi criteria
    By deanusa in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-20-2014, 01:48 AM
  2. Second criteria on vlookup
    By BrianBam in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-15-2013, 01:37 PM
  3. vlookup? match? index? MULTIPLE criteria for vlookup search problem....
    By aborg88 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-11-2013, 09:56 AM
  4. [SOLVED] Vlookup with 2 criteria?
    By reirobin in forum Excel General
    Replies: 11
    Last Post: 05-21-2012, 11:21 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