+ Reply to Thread
Results 1 to 2 of 2

Database Connection Nested VLookup option

  1. #1
    Registered User
    Join Date
    05-08-2006
    Posts
    1

    Question Database Connection Nested VLookup option

    I'm lost on this one. My train of thought seems simple, but I can't get it to work.

    Here is an example:

    Excel Workbook with 2 Spreadsheets
    Spreadsheet 1 is called: Server_Connect
    Spreadsheet 2 is called: Totals

    The Server_Connect sheet is queried to a SQL Database. The only thing that stays the sames is the columns. All other information is constantly changing.

    The Totals sheet is broken up. Its not uniform so each and every cell will have to contain a variant of the V or H lookup formulas. No easy way out of this one.

    Ok. Here is the problem, in Sheet1 (Server_Connect) I have 3 Columns:

    Name StockID CountofStockID

    I need to do a lookup function that will lookup by name, then by StockID and print the CountofStockID number in my selected cell. That’s it, but I can't figure it out. I keep getting the usual #NUM or #N/A error. I tried every know command to no avail. if(Name="Bob"(Hlookup...)) etc. The idea is there, but the numbers just aren't.

    Thank you for any info,
    Tom

  2. #2
    Pete_UK
    Guest

    Re: Database Connection Nested VLookup option

    Assume in your Totals sheet that you use cell A1 for the name, and cell
    B1 for the StockID. Try this array formula* in cell C1:

    =SUM(IF((A1=Server_Connect!A2:A5000)*(B1=Server_Connect!B2:B5000),Server_Connect!C2:C5000,0))

    I've assumed that you have data down to row 5000 - adjust to suit.

    * As this is an array formula, once you have typed it in (or
    subsequently edit it) you must use CTRL-SHIFT-ENTER instead of just
    ENTER. If you do this correctly then Excel will wrap curly braces { }
    around the formula - you should not type these yourself.

    Hope this helps.

    Pete


+ 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