Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Query table in excel, filter by date

Posted on 2014-01-18
7
Medium Priority
?
1,462 Views
Last Modified: 2014-01-21
I have a table of projects in Excel.  There is a column for Project Name and and column for End Date.  I would like a query in a separate worksheet that returns a column of data containing only those Project Names that end prior to a date I enter into a cell in Excel.  Suggestions for best way?

So far:
Pivot Table - does not have filter for less than arbitrary date.

Control Array - returns only filtered projects but leaves blank lines where projects do not match criteria.  I do not want blank lines.

VBA code - yes, I could build my own filter easily enough, but prefer existing tools if possible.  This may end up as best solution.

query builder - not friendly to finding tables in existing workbook.  I would like to be proven wrong about this.
0
Comment
Question by:RolandGarton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 31

Expert Comment

by:gowflow
ID: 39790927
I could help in VBA if and when you feel ready have a file posted first.
gowflow
0
 
LVL 16

Accepted Solution

by:
Jerry Paladino earned 700 total points
ID: 39792097
If your data is in a List / Table format then MS-Query is a simple solution.   In Excel 2007-2013 - Data menu, Get External Data, From Other Sources, "From Microsoft Query".   This uses ODBC to make a connection to the Excel files.   In the Choose Data Source dialog, select Excel Files*.   Select the workbook in the next dialog and then select the Worksheet in the "Add Tables" dialog.   There is an "Options..." button on the Add Tables dialog.  Make sure "System Tables" is checked or the available worksheets in the workbook will not display.

Use the ADD button to select one or more worksheets.   From there you have the ability to join tables and write SQL.   The user interface provides some drag and drop but don't expect MS-Access like capabilities.  

Screen shots below and the attached PDF show the steps to build a query and add the Parameter for selecting the date to show your projects.   The PDF is for a query to MS-Access but the steps are the same and the document is more detailed than the screenshots below.

HTH
Jerry
Project ListChoose data sourceSelect WorkbookAdd TablesQuery GridProperties dialogPropertiesParametersResult SetParameter-Query-with-Excel.pdf
0
 
LVL 33

Assisted Solution

by:Rob Henson
Rob Henson earned 100 total points
ID: 39796888
Have you looked at the Advanced Filter function?

This can extract data for specific columns that match specific criteria. This can be on a separate worksheet in the same workbook or can filter the data in place.

Thanks
Rob H
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Closing Comment

by:RolandGarton
ID: 39797235
Jerry - very helpful, thanks much.  I appreciate the examples.  I'm glad to know about the parametric option for queries--will be useful in other applications.  Problem, though: Once I created a new query, I then wanted to edit the query.  When I right-click/Table/Edit query I get the "connecting to data source..." box I'm used to, but this box does not eventually yield to Microsoft Query.  Instead, it hangs Excel and I have to use Task Manager to exit.  Do you know how I can edit the query after I've set it up?

Rob H - Thanks for the pointer.  Advanced Filter with copy elsewhere is an option I didn't know about.  It's a one-time deal that doesn't automatically update, so not as robust as Jerry's solution.
0
 
LVL 16

Expert Comment

by:Jerry Paladino
ID: 39798850
Roland,

Go to "Connection Properties" dialog box, which is the screen shot third from the bottom that I posted above.   To the left of the Parameters button is the Edit Query button.   That will take you back to the MS-Query screens.  Once you are comfortable with the SQL syntax you can edit the SQL that you see in the "Command Text" box on that same dialog if you want to.   Or, continue to use the drag and drop capabilities within MS-Query.

Use the "Refresh" dropdown on the Data Ribbon to get to the Connection Properties dialog box as shown below:Connection Properties
0
 

Author Comment

by:RolandGarton
ID: 39798965
Same problem.  I get the Connecting to data source dialog, and Excel hangs, to be stopped only through the Task Manager.

Connecting message
0
 
LVL 16

Expert Comment

by:Jerry Paladino
ID: 39798992
Roland,

Not sure since it works fine on both of my laptops.  May I suggest that you use two separate files as a place to start troubleshooting.   Have your complete list of projects in one workbook and setup the Query in second workbook.   That may avoid the connection issues you are experiencing.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question