+ Reply to Thread
Results 1 to 8 of 8

Two Criteria Lookup with Moving Starting Points

  1. #1
    Registered User
    Join Date
    07-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    4

    Two Criteria Lookup with Moving Starting Points

    Hi all,

    So I have been struggling with this problem for some time and I thought I had a fix, but it turns out, my approach was too complex and didn't work 100% o the time for some reason.

    So, the business problem:
    Each month Search, referred, and direct load change places as contributing the highest percentage of traffic to a website. EX:

    Date Date Indicator Traffic Source 1 Traffic Source 2 Traffic Source 3 Traffic Source Percentage 1 Traffic Source Percentage 2 Traffic Source Percentage 3
    Q1 2013 1 Referred Search Direct load 37% 32% 31%
    Q2 2013 2 Search Referred Direct load 44% 29% 27%
    Sample Data.xlsx
    I need to return this months sources in order, the percentages for this month, and next to each of these numbers, last months percentage.

    i.e.
    Search 44% 32%
    Referred 29% 37%
    Direct load 27% 31%


    The part I am struggling with is the previous months value. So essentially I have to look down using a vlookup (current month indicator -1), then in that row, look over to find "search", then go over three additional spaces from there, and return that percentage.

    I tried implementing match and or Hlookup, but each need you to know where the first row is to begin your lookup.

    Is there an easy way to do this? haha or even a complex way to do this?

    Thanks!
    Last edited by ImTheNeonTiger; 07-15-2013 at 12:49 PM.

  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: Two Criteria Lookup with Moving Starting Points

    Hi and welcome to the forum

    I dont see how you can get ANY data for "this month" seeing as all you have is data for 2 quarters?
    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
    07-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Two Criteria Lookup with Moving Starting Points

    Sorry, I meant quarter!

  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: Two Criteria Lookup with Moving Starting Points

    1st you need to make sure you have no leading/trailing spaces in your text (C3 has a trailing space)

    This got a bit more complex than I thought, but try this...

    for the 1st 1...
    =INDEX($C$1:$E$10,ROW(A2)+1,MATCH(LARGE($F3:$H3,COLUMN(A$1)),$F3:$H3,0))&" "&TEXT(LARGE($F3:$H3,COLUMN(A$1)),"0%")&" "&TEXT(INDEX($F2:$H2,1,MATCH(INDEX($C$1:$E$10,ROW($A2)+1,MATCH(LARGE($F3:$H3,COLUMN(A$1)),$F3:$H3,0)),$C2:$E2,0)),"0%")
    for the 2nd 1...
    =INDEX($C$1:$E$10,ROW(B2)+1,MATCH(LARGE($F3:$H3,COLUMN(B$1)),$F3:$H3,0))&" "&TEXT(LARGE($F3:$H3,COLUMN(B$1)),"0%")&" "&TEXT(INDEX($F2:$H2,1,MATCH(INDEX($C$1:$E$10,ROW($A2)+1,MATCH(LARGE($F3:$H3,COLUMN(B$1)),$F3:$H3,0)),$C2:$E2,0)),"0%")
    and for the 3rd...
    =INDEX($C$1:$E$10,ROW(C2)+1,MATCH(LARGE($F3:$H3,COLUMN(C$1)),$F3:$H3,0))&" "&TEXT(LARGE($F3:$H3,COLUMN(C$1)),"0%")&" "&TEXT(INDEX($F2:$H2,1,MATCH(INDEX($C$1:$E$10,ROW($A2)+1,MATCH(LARGE($F3:$H3,COLUMN(C$1)),$F3:$H3,0)),$C2:$E2,0)),"0%")

  5. #5
    Registered User
    Join Date
    07-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Two Criteria Lookup with Moving Starting Points

    Thanks so much for the response! So this works great for the example! Unfortunately I cannot get it to translate to the actual file, which is a bit more complex.

    So, whats really happening is that on the main sheet there is a drop down for Quarter. When this Quarter is selected, in the hidden data file, a vlookup is performed to establish the "Date Indicator" (essentially the number corresponding to the the current month). This way, back on the main dashboard we can easily do the vlookups to display this quarter's data, and last quarter ("Date Indicator"-1). There is, in reality, a few years of quarterly data, but for the sample data I just included 2 get the idea across.

    To make more sense I have attached the actual file, scrubbed of all propitiatory data. Dashboard Help.xlsm

    The dashes and #N/A are where I am struggling. Thanks so much! As you can see, my formulas can be quite convoluted.

  6. #6
    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: Two Criteria Lookup with Moving Starting Points

    ok whew, i *think* I have it

    assuming that columns AC:AH in your real data relate to C:H in your dummy data, i changed the formula to this, and put it in DM8, copied across (twice) and down...
    =INDEX($AC$6:$AE$30,ROW(A1)+1,MATCH(LARGE($AF8:$AH8,COLUMN(A$1)),$AF8:$AH8,0))&" "&TEXT(LARGE($AF8:$AH8,COLUMN(A$1)),"0%")&" "&TEXT(INDEX($AF$6:$AH7,ROW(A1)+1,MATCH(INDEX($AC$6:$AE$30,ROW($A1)+1,MATCH(LARGE($AF8:$AH8,COLUMN(A$1)),$AF8:$AH8,0)),$AC7:$AE7,0)),"0%")

    If you want it/them anywhere else, cut/paste or move, dont just copy/paste

  7. #7
    Registered User
    Join Date
    07-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Two Criteria Lookup with Moving Starting Points

    This is what I came up with:

    =IF(INDIRECT(ADDRESS(ROW(AN7),SUMPRODUCT(($AN7:$AR7=AN8)*(COLUMN($AN7:$AR7)))+5))>=1,0,INDIRECT(ADDRESS(ROW(AN7),SUMPRODUCT(($AN7:$AR7=AN8)*(COLUMN($AN7:$AR7)))+5)))

  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: Two Criteria Lookup with Moving Starting Points

    ok great what answer does that give 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. generic VBA to work on different file names with different cell starting points
    By bmorro in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-12-2012, 03:27 PM
  2. Doublecheck with second lookup starting starting after first match
    By zekethewolf in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-06-2011, 06:36 AM
  3. Replies: 6
    Last Post: 08-16-2008, 10:24 AM
  4. [SOLVED] finding 1st populated cell on a vector with varying starting points
    By nickname in forum Excel General
    Replies: 0
    Last Post: 07-17-2006, 09:20 PM
  5. Different Starting Points on X-Axis
    By Xavier in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 01-29-2006, 05:30 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