+ Reply to Thread
Results 1 to 5 of 5

Vlookup on Dynamic Range that expands vertically and horizontally

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-22-2013
    Location
    US
    MS-Off Ver
    Mac Version 2011
    Posts
    126

    Vlookup on Dynamic Range that expands vertically and horizontally

    Hi guys,

    I have a problem. I am working on the number of applications coming from different countries on each day. What I am trying to create is a summary of the number of applications from each day, from each country, and from each country in the last 7 days.

    I have created a pivot table but since it is going to be cumulative, the date and the number of countries will expand. Now I am looking at a pivot table that will expand both horizontally and vertically. I don't know how to do vlookup on it. Unless you have a better idea.

    I'm attaching the workbook here.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Vlookup on Dynamic Range that expands vertically and horizontally

    Only thing that jumps to my eye is this:

        ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
            Range("DynamicRange_Reject"), Version:=xlPivotTableVersion14).CreatePivotTable _
            TableDestination:="Rejected!R1C9", TableName:="PivotTable18", _
            DefaultVersion:=xlPivotTableVersion14

    After fixing that, the PIVOT TABLE button seems to update properly each time it is pushed.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    08-22-2013
    Location
    US
    MS-Off Ver
    Mac Version 2011
    Posts
    126

    Re: Vlookup on Dynamic Range that expands vertically and horizontally

    Hi JBeaucaire,

    Thank you for your reply. However, let's not worry about the macro because I was testing formulas and it messed up the macro. What I wanted to solve is different.

    Let's look at the tab "Approve", you will see a pivot table with date, countries, and the count. Now go to tab "Total Applications", I want to be able to count the number of applications by specific countries and also by date. If I set a specific range, that would be easy. However, as time goes on there will be new data added to the source which would expand the pivot table (new dates, new countries). The question is, how can I do a vlookup (or anything to look up) based on a dynamic pivot table like that?

    Do you understand my question? Please help because I really need it solved quickly.

    Thanks.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Vlookup on Dynamic Range that expands vertically and horizontally

    Why macro at all? Put this formula in B19, then copy down/across the table:

    =COUNTIFS(Approved!$B:$B, B$18, Approved!$D:$D, $A19)

  5. #5
    Forum Contributor
    Join Date
    08-22-2013
    Location
    US
    MS-Off Ver
    Mac Version 2011
    Posts
    126

    Re: Vlookup on Dynamic Range that expands vertically and horizontally

    Hi JB,

    Sorry work has caught up to me the whole morning. Anyway, your formula worked and I am so appreciative that your help came on time.

    I will look forward to receiving more great tips from 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. [SOLVED] Look into a range of cells (horizontally and vertically) and return a number
    By sordid in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-23-2013, 07:06 AM
  2. [SOLVED] Sumproduct vertically and horizontally
    By jimstrongy in forum Excel General
    Replies: 2
    Last Post: 03-21-2012, 04:37 PM
  3. Replies: 3
    Last Post: 05-10-2011, 03:53 AM
  4. Excel 2007 : Merging data horizontally vs. vertically
    By enhydra in forum Excel General
    Replies: 4
    Last Post: 12-12-2010, 06:16 PM
  5. [SOLVED] Move cells vertically to horizontally
    By Abe in forum Excel General
    Replies: 1
    Last Post: 03-22-2005, 11:07 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