+ Reply to Thread
Results 1 to 12 of 12

Vertically look up multiple row entries with different field entries

  1. #1
    Registered User
    Join Date
    09-17-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    16

    Vertically look up multiple row entries with different field entries

    I'm going to use a hypothetical for this because I don't know how to explain it lol

    I'm a receptionist and I keep a database of clients, each with a number. Some visit my business regularly, others not so regularly. Every time they visit I enter their number and what they purchased when they visited. I have around ten fields of items, and 300 visit entries. The clients bought differeny things every time.

    Is there a way for me to type a client number into Sheet 2 and have all the visits and purchases from that client pop up?

    Thanks for any help

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Vertically look up multiple row entries with different field entries

    Do you want just that client on sheet 2? Is the client number in column A in sheet 1?

    It can be done quite handily, but I need more particulars!
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,800

    Re: Vertically look up multiple row entries with different field entries

    What you need to do is to set up a unique reference for each entry in Sheet1, but still linked to the client number. Suppose the client number is in column A, then in column L you could have this formula to give you such a unique reference:

    =IF(A2="","-",A2&"_"&COUNTIF(A$2:A2,A2))

    Copy this down (even beyond your data, so that it is there for new entries in future). You will see that it produces unique references like 101_1, 101_2, 102_1 etc, so you can see the client number and then a sequential number after the underscore. Now, because that unique reference is not in the left-most column of the table, you won't be able to use VLOOKUP to retrieve the data on Sheet2 - instead you need to use an INDEX/MATCH combination. I would suggest just having the MATCH formula once (in the same column as on Sheet1), so imagine you enter the client number in K1 of Sheet2, then put this in L2 of Sheet2:

    =IFERROR(MATCH(K$1&"_"&ROWS($1:1),Sheet1!L:L,0),"-")

    Then in A2 you could have this formula:

    =IF($L2="","",INDEX(Sheet1!A:A,$L2))

    to get the data for column A. This formula can be copied across to J2 (you did say you had 10 columns of data), and then all the formulae in row 2 can be copied down as far as you need them.

    Now, just change the client number in K1 to see another set of data.

    Hope this helps.

    Pete
    Last edited by Pete_UK; 09-19-2012 at 05:33 AM. Reason: missing ) in first formula, also missing quotes

  4. #4
    Registered User
    Join Date
    09-17-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Vertically look up multiple row entries with different field entries

    Hi Pete, thanks heaps for that

    I have yet to look into those sums, I won't ask you to explain - I should be able to figure it out

    I thought it'd be a good idea to clarify exactly what's in my spreadheet so far, though

    On the first sheet I have client visits
    On the second sheet I have a list of over 2000 clients
    On the third sheet I have used VLOOKUP to compile client inormation from sheet two (so I just throw a client number into the specified cell and it shows me all the fields).

    So I'd like to get individual visits per client and what they purchased into either sheet 3 or sheet 4. Sheet one goes to column R, with column A as dates and column B as client numbers. Then just data per field from there.

    I'm going to have a go at what you've suggested here after some Googling, but does my explanation change anything with your answer?

    Thanks heaps Pete : )

  5. #5
    Registered User
    Join Date
    09-17-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Vertically look up multiple row entries with different field entries

    I tried the first equation in S2 and I got an error, it says #NAME? I suspect I'm supposed to have something inbetween the quotation marks ? Sorry if this is a stupid question lol

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Vertically look up multiple row entries with different field entries

    Can you upload a small sample workbook?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  7. #7
    Registered User
    Join Date
    09-17-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Vertically look up multiple row entries with different field entries

    Hi Fotis,

    I'm using my iPhone, I'm happy to answer any questions in detail

    In the first sheet I have set it up so the date comes in column A and the client number in column B, then some fields are money, some are a 'y' for 'yes', some are numbers (not currancy), some are just notes. We provide specific services so these services are defined in row 1, and recorded in the fields.

    Some clients visit more than once - I'm looking for a way I could type the number (after setting up a sheet for the visit details) and Excel filters that number's visits, showing me all the rows from sheet 1 with their number in column B..?

  8. #8
    Registered User
    Join Date
    09-17-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Vertically look up multiple row entries with different field entries

    Basically I want to say to excel;

    Search 'this number' in column B on sheet one, then return all the field data for all duplicates of that number, including the date in column A

    It'd be even better if I could control which fields were returned, but I think that'd be more diffucult, just want to know how to filter to a new sheet first : )
    Last edited by Yupyup; 09-19-2012 at 02:40 AM.

  9. #9
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,800

    Re: Vertically look up multiple row entries with different field entries

    I've just noticed that I had missed quotes from around the underscore in the first formula - that explains why you got the #NAME error. I've corrected the formula in my first post, so try it again, although your references will probably be to column B, like this:

    =IF(B2="","-",B2&"_"&COUNTIF(B$2:B2,B2))

    as you say that is where your client number is. If the formula is in S2, then you will also need to amend the references in the other formulae that I gave you from column L to column S.

    Hope this helps.

    Pete

  10. #10
    Registered User
    Join Date
    09-17-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Vertically look up multiple row entries with different field entries

    Hey Pete

    Thanks again for your help on this, I think I'm getting somewhere

    I've got the formula in Sheet 1 working, I have a client number in k1 sheet2, i have the l2 formula in S2.. I'm trying this out on the first ten entries in the Daily Sheet

    I've got;

    =IF(B2="","-",B2&"_"&COUNTIF(B$2:B2,B2)) in column S sheet1

    =IFERROR(MATCH(K$1&"_"ROWS($1:1),'Daily Sheet'!L:L,0),"-") in S2 sheet 2 (this one opened the file thing when I pressed enter?)

    =IF($L2="","",INDEX('Daily Sheet'!A:A,L2)) in A2

    I have a client number in K1 sheet2

    Nothing is showing up? Have I missed something?

    I think I understand about half of what I'm asking it to do now lol

  11. #11
    Registered User
    Join Date
    09-17-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Vertically look up multiple row entries with different field entries

    Just realised that was a stupid question!

    I think I got it! Just gotta play around a little more, if I have any questions I know where to come

    Thanks so much!!

  12. #12
    Registered User
    Join Date
    09-17-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Vertically look up multiple row entries with different field entries

    I've already got stuck

    I've dragged all the sheet2 S-column formulas down and the A2 formulas down and accross, and it's showing me all the visits, not just the visits for that client?

+ 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