Note that there are some explanatory texts on larger screens.

plurals
  1. POExcel VBA Lookup Methods
    text
    copied!<p>I have an issue that I've been scratching my head at; I've looked into the <code>Index:Match</code> lookup method, and <code>V/HLookup</code>, but I'm not sure these will help just yet. Here's what's happening:</p> <p>I have two worksheets in <a href="/questions/tagged/excel-2007" class="post-tag" title="show questions tagged 'excel-2007'" rel="tag">excel-2007</a>. One has a Customer ID column (which does and will have duplicate ID's in the instance that the customer did "x activity" more than one time in a month) and then the date that this happened in another column. The second sheet is for giving an overview of a specific day, IE what happened on 7-1-13.</p> <p>The issue is that my raw data sheet is sorted via the first of the month descending, so 7-1,7-2,etc, and when I run the <code>Vlookup</code>, if a Customer ID has a record on 7-2 and on 7-15, the <code>VLookup</code> will pull data only from the 7-2 (first) row. Has anyone experienced this and found a workaround?</p> <p>My current workaround would be to make either a new table for each day's data, or instead of using my <code>VLookup</code> of <code>=Vlookup(A2, 'Data Sheet' A:D, 4, 0)</code> to give the columns row numbers, like <code>=Vlookup(A2, 'Data Sheet' A$1:D$30, 4, 0)</code>. This is a daily report, and that would be intense. Please help if you can!</p> <p>(Another side note, I have one main sheet for the view, one data sheet where it's all collected, and then 30 sheets, one for each day of the month, this case being July). For each sheet, I've named them the day of the month, so I'm reflecting the data as such:</p> <p>Sheets("7-1-13") has data from the 1st on it. The Data Sheet in it's entireity has data from 7-1-13 to 7-31-13. I need to reference ID's on the 1st to the data for the 1st and the 1st only.</p> <p>I want to use something like this, but I'm having a hard time with it</p> <pre><code>=Vlookup(A2, 'Data Sheet', A:D (ONLY IF THE CREATE DATE OF THIS ITEM IS 7-1), 4,0)` </code></pre> <p>but of course it's not that easy :p</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload