+ Reply to Thread
Results 1 to 14 of 14

VLookup...Wrong Formula?

Hybrid View

  1. #1
    Registered User
    Join Date
    07-22-2004
    Posts
    29

    VLookup...Wrong Formula?

    I have 2 Workbooks. One is invoice data extracted from SAP and the other is a workbook I have to send to the client (has about 10 worksheets containing 5-10 different branches in each worksheet). The layout of the one I send to the client can not change so I am trying to import the values form the 1st workbook (SAP) into the 2nd workbook. What I do now is copy the first 4 columns of data for each branch and paste it into the 2nd workbook.

    I was playing with a VLookup formula but I don’t think that is the correct formula. I need the second workbook to be populated with all the invoice info (Number, Type, Date, Balance) that appears in the raw data workbook.

    =VLOOKUP(H14,'[abcbank raw data sample.xls]Sheet1'!$A:$A+'[abcbank raw data sample.xls]Sheet1'!$A:$E,4)

    H14 is the branch number on the client sheet (I cut the column containing the branch # on the raw data and inserted it before column A).



    Raw Data From SAP
    Number	Type	Date	 Balance 	Account
    1244739	ZF	2/9/2007	              $      72.33 	2236
    1261054	ZF	2/16/2007	 $      50.71 	2279
    1544106	ZF	6/15/2007	 $      59.62 	2279
    1785273	ZF	10/5/2007	 $    213.51 	2279
    1843990	ZF	11/2/2007	 $ 3,504.11 	2279
    1858697	ZF	11/9/2007	 $ 3,796.73 	2279
    1872887	ZF	11/16/2007	 $ 3,550.69 	2279
    1208220	ZF	1/26/2007	 $    693.67 	2281
    1261055	ZF	2/16/2007	 $    424.98 	2281
    1277184	ZF	2/23/2007	 $    378.22 	2281
    1313065	ZF	3/9/2007	              $ 1,125.21 	2281

    Workbook to send to client
    1261054	ZF	2/16/2007	 $      50.71 	SAP# 2279
    1544106	ZF	6/15/2007	 $      59.62 	2279
    1785273	ZF	10/5/2007	 $    213.51 	
    1843990	ZF	11/2/2007	 $ 3,504.11 	
    1858697	ZF	11/9/2007	 $ 3,796.73 	
    1872887	ZF	11/16/2007	 $ 3,550.69


    Let me know if you need a better explanation.

    Thanks.
    Last edited by shg; 12-24-2007 at 12:58 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try this formula

    =VLOOKUP(H14,'[abcbank raw data sample.xls]Sheet1'!$A:$E,Column(B$1),0)
    copied down and across as far as needed.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    07-22-2004
    Posts
    29

    Cool Close

    Thanks NBVC. This is close. I made H14 Constant since that is my branch # I am searching for. When I copy across it works but when I copy down it returns only the values for the 1st invoice from the list. For branch # 2279 there are 6 invoices that I need to copy over. Can the VLookup do that or does it only return the first value in it's search?


    =VLOOKUP($H$14,'[abcbank raw data sample.xls]Sheet1'!$A:$E,COLUMN(B$1),0)


    Attached is a word doc of two of the excel sheets. The 1st page is the raw data and the 2nd page is the form it needs to flow into.
    Attached Files Attached Files

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

  5. #5
    Registered User
    Join Date
    07-22-2004
    Posts
    29
    davesexcel- That is an interesting macro. I think I can use that for another spreadsheet I have, but it will not work for this one. I have to have the data put into specific cells so I can't just produce a list.

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,697
    This is not a simple exercise using formulas but you could use something like the attached, based on your data.

    Note: formula in B3 is

    =IF(COUNTIF(Sheet1!$A$1:$A$24,$A$3)>=ROWS(B$3:B3),INDEX(Sheet1!B$1:B$24,SMALL(IF(Sheet1!$A$1:$A$24= $A$3,ROW(Sheet1!B$1:B$24)-ROW(Sheet1!B$1)+1),ROWS(B$3:B3))),"")

    which is an array formula which needs to be confirmed with CTRL+SHIFT+ENTER

    which is copied down and across
    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)

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