+ Reply to Thread
Results 1 to 4 of 4

VLOOKUP Function

  1. #1
    Registered User
    Join Date
    12-10-2014
    Location
    Worthing, England
    MS-Off Ver
    Office 2003
    Posts
    4

    VLOOKUP Function

    Hi,

    Please HELP!

    I have 4 coloums of data. In Coloumn A, I have Road Names (i.e Jones Street, Bond Street, James Street....etc) Coloumn B contains issues (i.e. Cracked paving stone, Pothole, Ditch...etc). This information goes down the spreadsheet and there may be more than one row for each road if that road has more than one issue. (please see example below).

    COLOUMN A COLOUMN B
    Jones Street Cracked Paving
    Jones Street Pot Hole
    Bond Street Pot Hole
    James Street Cracked Paving
    James Street Pot Hole
    James Street Ditch

    I have a cell D1 that is a drop down box with a list of all the road names. I want it so when for example James Street is picked below in the nest three rows it displayes the issues with James Street. I have tried a VLOOKUP but only displays one row.

    Please help, thanks

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: VLOOKUP Function

    Since you are using 2003, try this array formula, copied down

    =IF(COUNTIF($A$1:$A$6,$D$1)>=ROWS($A$1:$A1),INDEX($B$1:$B$6, SMALL(IF($A$1:$A$6=$D$1, ROW($A$1:$A$6)),ROWS($A$1:$A1))),"")
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: VLOOKUP Function

    Please see the attachment.

    I've created a user defined function which returns the nth occurence.

    =GetIssue($A$2:$A$7,$D$1,2)

    =GetIssue(Range of street names,location of the drop down,occurence number)

    The code is in Module1 (alt F11).
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    606

    Re: VLOOKUP Function

    I've done yet another version that uses a helper column (which can be hidden)
    Attached Files Attached Files

+ 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. Replies: 2
    Last Post: 01-15-2014, 11:40 PM
  2. Need help nesting an index/match function within a Vlookup function.
    By Christopher135 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-04-2013, 06:16 PM
  3. Worksheet function Vlookup and VLOOKUP return different results
    By zandero in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-08-2010, 08:24 AM
  4. Replies: 1
    Last Post: 12-02-2005, 09:35 AM
  5. [SOLVED] vlookup function-Can vlookup command find the data from the 5 sheets.
    By Rishab shah in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM

Tags for this Thread

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