+ Reply to Thread
Results 1 to 4 of 4

VLOOKUP loop multiple times

  1. #1
    Lenny
    Guest

    VLOOKUP loop multiple times

    I am trying to help an Analyst at a police department. She is trying to
    search crime data in Excel and put it into a calendar. I found an Excel
    Calendar on Microsoft's web site, each day is one cell. I then put a
    VLOOKUP formula that goes to another sheet and returns the crime based
    on the date. i.e.

    8/1/2005 FALSE INFO TO OFFICER
    8/1/2005 N&D/PARAPHERNALIA
    8/1/2005 MUNI CODE/SOLICIT W/O PERMIT
    8/2/2005 ASSAULT WITH DEADLY WEAPON
    8/2/2005 BATTERY/SIMPLE

    The problem I can't figure out how to Loop the formula multiple times
    and CONCATENATE the results so I can paste them back into the Cell that
    contains the date.

    Any Ideas?

    Lenny


  2. #2
    Forum Contributor
    Join Date
    06-23-2004
    Location
    Houston, TX
    Posts
    571
    Quote Originally Posted by Lenny
    I am trying to help an Analyst at a police department. She is trying to
    search crime data in Excel and put it into a calendar. I found an Excel
    Calendar on Microsoft's web site, each day is one cell. I then put a
    VLOOKUP formula that goes to another sheet and returns the crime based
    on the date. i.e.

    8/1/2005 FALSE INFO TO OFFICER
    8/1/2005 N&D/PARAPHERNALIA
    8/1/2005 MUNI CODE/SOLICIT W/O PERMIT
    8/2/2005 ASSAULT WITH DEADLY WEAPON
    8/2/2005 BATTERY/SIMPLE

    The problem I can't figure out how to Loop the formula multiple times
    and CONCATENATE the results so I can paste them back into the Cell that
    contains the date.

    Any Ideas?

    Lenny
    One way ...

    ASSUME that the dates are entered in Column A and the corresponding crime descriptions are in Column B.

    If the date is entered in, say, Cell C1, enter this formula in Cell C2

    =INDEX($B$1:$B$100,SMALL(IF($A$1:$A$100=C$1,ROW($B$1:$B$100)),ROW(1:1)))

    and copy down to suit your requirements.

    BTW, the above is an array, so use "Ctrl+Shift+Enter" (instead of simply doing "Enter") in committing this formula.

    Hope this is what you need.

    Regards.
    BenjieLop
    Houston, TX

  3. #3
    Lenny
    Guest

    Re: VLOOKUP loop multiple times

    I don't think i explained it good enough let me try again.
    In Sheet2 I have the following crime data and it could be a couple of
    hundred rows

    8/1/2005 FALSE INFO TO OFFICER
    8/1/2005 N&D/PARAPHERNALIA
    8/1/2005 MUNI CODE/SOLICIT W/O PERMIT
    8/2/2005 ASSAULT WITH DEADLY WEAPON
    8/2/2005 BATTERY/SIMPLE

    I am in now back in Sheet1 Cell A1 I want a formula that will read
    Sheet2 and Concatenate all the info for the first date like this into
    one Cell
    FALSE INFO TO OFFICER
    N&D/PARAPHERNALIA
    MUNI CODE/SOLICIT W/O PERMIT

    I will write another formula that will put then data from the next date
    into anohter cell untill I have all the data for the month.

    I showed her how to do this with a pivot table but she wants it to look
    like a calendar.

    Thanks Again,
    Lenny


  4. #4
    Forum Contributor
    Join Date
    02-19-2005
    Location
    Gurgaon,India
    MS-Off Ver
    2007,2010,2013
    Posts
    180
    Hi Lenny,

    Try,

    In Sheet1 B1,

    =SUBSTITUTE(aconcat(IF(Sheet2!A1:A5=A1,Sheet2!B1:B5),", "),", False","")

    where A1 houses Date

    Confirm with Ctrl+Shift+Enter

    ACONCAT is a Function and below is the code;

    Please Login or Register  to view this content.
    HTH
    Kris

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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