Solved

Is it possible to have Excel 2007 display a list of result

Posted on 2011-09-29
16
193 Views
Last Modified: 2012-05-12
We have used vlookup, find, search, mid, left, right, etc. to search and display a singular cell contents.  But can Microsoft Excel  2007 be used to display a list of results?

Attached is an Excel with what we think it would be set out.  In this example we have an area where the 'Data' is store, then where the user inters the data to search, finally, the Results display area.  

Is this possible? and how can we go about it?


DisplayListResult.xlsx
0
Comment
Question by:rayluvs
16 Comments
 
LVL 33

Assisted Solution

by:Rob Henson
Rob Henson earned 400 total points
ID: 36815353
Looks like you can use the AutoFilter or Advanced Filter functions for this.

Auto Filter would filter in place whereas Advanced Filter can be used to filter to another location.

Adv Filter would be better for your purpose as it requires 3 inputs:
Data Range - Your Data
Criteria Range - your Enter Data to display range for your example this would be input as *speed*
Output Range - your Results.

This can be automated so that it updates at the click of a button if so required.

Does this sound like a way forward?

Thanks
Rob H
0
 
LVL 19

Assisted Solution

by:akoster
akoster earned 50 total points
ID: 36815372
sure.

easiest way is to place a filter on the data range and select "text filter" - "contains" - "*speed*"

as in the M column

 DisplayListResult.xlsx
0
 
LVL 1

Assisted Solution

by:Doddsy1000
Doddsy1000 earned 50 total points
ID: 36815404
I'm sure I've mis-understood the question.  Please use the attached to clarify.

thanks

Ian

DisplayListResult.xlsx
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:rayluvs
ID: 36815410
Yes, that's what we're looking for.

But is there a way to go straight to "Contains" instead of Click Filter >> Text Filter >> Click Contains ?
0
 
LVL 33

Accepted Solution

by:
Rob Henson earned 400 total points
ID: 36815540
See attached, your original and a Copy sheet.

Filter button on the Copy sheet runs this routine:

Sub Filter()
'
' Filter Macro
' Macro recorded 29/09/2011 by Rob Henson
'

'
    Range("K7").Select
    Selection.CurrentRegion.Select
    Selection.ClearContents
    Range("K7").Select
    
    Range("D7").Select
    Selection.CurrentRegion.Select
    With Selection
        .AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
        "H7:H8"), CopyToRange:=Range("K7"), Unique:=False
    End With
    
End Sub

Open in new window


That clears the result area and filters the Data.

Thanks
Rob
0
 
LVL 33

Assisted Solution

by:Rob Henson
Rob Henson earned 400 total points
ID: 36815566
Ooops, attachment.
Display-List-Result.xls
0
 
LVL 33

Assisted Solution

by:Rob Henson
Rob Henson earned 400 total points
ID: 36815662
The ranges in the routine are currently 'hard-coded'.

As the data will no doubt change shape, the ranges can be made dynamic.

Thanks
Rob H
0
 

Author Comment

by:rayluvs
ID: 36818365
Great!... i see that in order for CONTAIN to work, there has to be '*'.  Can the filter always use CONTAIN so the user just enter the word|? (for example if I enter 'speed' nothing is display, but if i enter *speed or *speed*, it does)
0
 
LVL 33

Assisted Solution

by:Rob Henson
Rob Henson earned 400 total points
ID: 36818421
I guess you could set a change event on the sheet that whenever anything is added to the search list an * is added.

Alternatively, you could use the same input but have the actual criteria list of to one side with formulae populating the * onto the words entered.  This new criteria list would then have to be dynamic so that the filter knows how many rows it needs to look at.

Thanks
Rob H
0
 
LVL 33

Assisted Solution

by:Rob Henson
Rob Henson earned 400 total points
ID: 36818427
BTW in case you weren't aware the * is a wild card for any character(s). You can also use ? for a single character.
0
 

Author Comment

by:rayluvs
ID: 36893357
I just finished incorporating your recommendations and it doesn't work.

Question:

The title all have to be 'Data'? (we have other titles)
0
 

Author Comment

by:rayluvs
ID: 36893361
i just tested changing, it seems that all title have to be the same?
0
 
LVL 33

Assisted Solution

by:Rob Henson
Rob Henson earned 400 total points
ID: 36894210
Yes the tiles have to be the same, or at least the cell above the first row of data!!

The Advanced Filter function is saying:

Look at table of values, in column Data find the values specified in the criteria table with criteria for column Data and return the values that match the criteria. It would make more sense if you had more columns, the example in the Help is very basic but proves the point. It has an orchard with multiple trees of different fruits with various heights and ages.

So you have columns for:

Fruit    Height (Ft)    Age (Yrs)
Apple  10                 2
Pear    10                 1
Apple    6                  1
Apple    5                  1

You could then set up a criteria table with

Fruit       Height(Ft)
Apple     >5

The result would then be:

Fruit    Height (Ft)    Age (Yrs)
Apple  10                 2
Apple    6                  1

As you can see you only need the column headers for those columns for which criteria are being specified. Likewise the result table can be preset with only the headings you require data to b extracted for.

In your example you could make the headings different by adding more to the cell above, like you did for the criteria in your original post; the AF looks at only the first row of the range specified and treats that as the header.

Thanks
Rob H
0
 
LVL 33

Assisted Solution

by:Rob Henson
Rob Henson earned 400 total points
ID: 36894229
Reading your question in a different light, possibly answered with the Orchard example, the title doesn't have to be "Data" but the titles of the columns in the data have to be repeated in the title for the criteria and will then be repeated in the title for the result. Going on from what I suggested about adding to the cell above the header, the result will only have the immediate header so any extra titles will have to be added before and will stay when the filter is refreshed if the result area is set as the row below.

Thanks
Rob H
0
 

Author Comment

by:rayluvs
ID: 36894516
Thanx you very much!
0
 

Author Closing Comment

by:rayluvs
ID: 36896948
Thanx
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

828 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