+ Reply to Thread
Results 1 to 11 of 11

Vlookup based on 2 conditions through multiple sheets?

Hybrid View

  1. #1
    Registered User
    Join Date
    11-25-2014
    Location
    Isle of Man
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    82

    Vlookup based on 2 conditions through multiple sheets?

    I have a list of fund names in Column A. I also have currencies for these in column B. Some fund names may exist more than once but using different currencies.

    I need a formula in column C which will populate data from column C of my multiple other sheets. These have a name range of 'Sheets' . This has to be based on both the fund name AND the currency though?

    So far I can only get it to look up based on the fund name, and not the currency also.

    This is the formula I am currently using:
    =IFERROR(VLOOKUP(A1,INDIRECT(INDEX(Sheets,MATCH(1,COUNTIF(INDIRECT(Sheets),A1),0))),3,0),"N/A")

    Is anyone able to help me with this? :/

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,950

    Re: Vlookup based on 2 conditions through multiple sheets?

    It would helpful if you can post a sample workbook showing required results.

  3. #3
    Registered User
    Join Date
    11-25-2014
    Location
    Isle of Man
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    82

    Re: Vlookup based on 2 conditions through multiple sheets?

    SAMPLE.xlsx


    Please find an example spreadsheet attached above.

    'ISIN Tracker' is my main sheet where I want column C to pick up data. But I need this to search using both Column A AND the currency in column B.

    Please let me know if you need any more information!

  4. #4
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: Vlookup based on 2 conditions through multiple sheets?

    The array formula won't search through all of the spreadsheets in your list. The best way I could do it was with helper columns and using this formula:
    =SUMIFS(INDIRECT(D$1&"$C:$C"),INDIRECT(D$1&"$A:$A"),$A2,INDIRECT(D$1&"$B:$B"),$B2)
    I tried an array formula using index and match with 2 criteria, but it took so much processing power that it wasn't worth it. Luckily you are searching for a number and in this case you can just sum the numbers found.
    Attached Files Attached Files
    Some people volunteer in soup kitchens or hospitals. I choose to make the world better by trying to help you with Excel. We're all learning.

    <---Click * Add Reputation for all helpful comments. It's like giving a smile.
    Forum Rules: How to mark your post [Solved] and have a happier, Excel enriched life.

  5. #5
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: Vlookup based on 2 conditions through multiple sheets?

    Your current solution is pretty amazing for looking up all of the sheets based on 1 criteria. I will have to save it and try it in other places.

  6. #6
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: Vlookup based on 2 conditions through multiple sheets?

    I think this array formula may work in C2. I used your array formula and just changed the countif to a countifs so I could add multiple criteria. I also changed the Cell references on the first tab so they only reference the tab. That way I can control what column it is looking at in the countifs section.

    =IFERROR(VLOOKUP(A2,INDIRECT(INDEX(Sheets&"$A:$C",MATCH(1,COUNTIFS(INDIRECT(Sheets&"$A:$A"),A2,INDIRECT(Sheets&"$B:$B"),B2),0))),3,0),"N/A")

  7. #7
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: Vlookup based on 2 conditions through multiple sheets?

    It looks like you got the original formula from here: http://www.myonlinetraininghub.com/e...ultiple-sheets

    High five to Mynda Treacy who created it. It is quite an amazing feat.

  8. #8
    Registered User
    Join Date
    11-25-2014
    Location
    Isle of Man
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    82

    Re: Vlookup based on 2 conditions through multiple sheets?

    Thanks for your above suggested solution. What do I need to change to make this work? (aside from pasting the code into C2). Sorry, I'm a total excel newb :/

  9. #9
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Vlookup based on 2 conditions through multiple sheets?

    I would add all data in 1 sheet (with a macro).

    After that a pviot table to analyze the data.

    I gave an example in the sheet.

    See the attached file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  10. #10
    Valued Forum Contributor nigelbloomy's Avatar
    Join Date
    11-06-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1,011

    Re: Vlookup based on 2 conditions through multiple sheets?

    @Kelly. Right now your list on the first tab has the name of the sheet and the cells to look at. Like this:
    'DAILYBBPT'!A1:C4000
    If you change it to just the sheet name like this:
    'DAILYBBPT'!
    Then my formula will use that sheet name and add in the cell references.
    =VLOOKUP(A2,INDIRECT(INDEX(Sheets&"$A$1:$C$1000",MATCH(1,COUNTIFS(INDIRECT(Sheets&"$A$1:$A$1000"),A2,INDIRECT(Sheets&"$B$1:$B$1000"),B2),0))),3,0)
    It is pretty intersting to do all of this in one cell. If possible I would still recommend the helper colums like in my first example. They make it easier to trouble shoot and add new sheets. It is also easier for someone else to understand what is going on.

  11. #11
    Registered User
    Join Date
    11-25-2014
    Location
    Isle of Man
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    82

    Re: Vlookup based on 2 conditions through multiple sheets?

    Thanks for the explanation, that seems to make sense! I'll use this from now on Thank you!!

+ 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. Vlookup based on two cells to populate from multiple sheets?
    By kellyfirth in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-07-2015, 02:07 PM
  2. Replies: 1
    Last Post: 10-01-2013, 02:41 AM
  3. Create a nesting formula w/ multiple conditions based on fields w/VLOOKUP
    By NiqueDomie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-14-2011, 09:59 AM
  4. Summarise multiple sheets based on conditions
    By Lotte Torkilson in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-06-2009, 05:31 PM
  5. Vlookup on multiple sheets based on date
    By Trish21 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-15-2008, 01:42 AM

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