+ Reply to Thread
Results 1 to 4 of 4

Excel 2007 : vlookup and/or If Statement Help

  1. #1
    Registered User
    Join Date
    12-14-2010
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    2

    vlookup and/or If Statement Help

    This is driving me batty. I know I need 2 different vlookup and/or IF statements, but I can't figure it out. Here is my data.

    Sheet 1 -
    Company --- Line - -- Dollars

    DC --- 300 --- $100
    DC --- 300.1 --- $3,000
    DC --- 400.1 --- $4,500
    DC --- 420 --- $1,000
    IL --- 300.1 --- $600
    IL --- 302 --- $150
    IL --- 400.1 --- $84
    IL --- 420 --- $5,000

    Sheet 2 -
    Company --- Line 1 --- Line 2

    DC --- ?? ----- ??
    IL --- ?? ---- ??



    On Sheet 2, I want Line 1 to = the sum of all 300 lines (meaning lines starting w/ a '3')from Sheet 1 for each company.

    On Sheet 2, I want Line 2 to = line 420 from Sheet 1 for each company.

    Thank you!
    Last edited by twak21; 12-14-2010 at 04:28 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: vlookup and/or If Statement Help

    Try use a pivot table.

    If you don't know how post a example workbook.

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

    Re: vlookup and/or If Statement Help

    For Line 1, try:

    =SUMPRODUCT(--(Sheet1!$A$2:$A$9=$A2),--(LEFT(Sheet1!$B$2:$B$9)="3"),Sheet1!$C$2:$C$9)

    where Shee1, A2:C9 contains your table and A2 of your summary sheet contains "DC"

    copied down

    for Line 2, formula:

    =SUMPRODUCT(--(Sheet1!$A$2:$A$9=$A2),--(Sheet1!$B$2:$B$9=420),Sheet1!$C$2:$C$9)
    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.

  4. #4
    Registered User
    Join Date
    12-14-2010
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: vlookup and/or If Statement Help

    NBVC - Awesome! This works great. Thanks so much - I would have never figured it out.

+ 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