+ Reply to Thread
Results 1 to 9 of 9

VLookup and Left/Right Extraction?

  1. #1
    Forum Contributor
    Join Date
    02-25-2008
    Location
    Windsor, ON Canada
    MS-Off Ver
    Excel 2007, 2003
    Posts
    119

    VLookup and Left/Right Extraction?

    This may be a dumb question, but I want to use the vlookup function to help return the value in column 2, IF the reference cell matches the left 4 characters in column 1.

    Oh, and also, is there a way to add together the returned values if it happens that more than one entry is valid?

    All of this in one formula. I'm thinking it's not really feasible. Anyway, here's a sample of data


    Column A Column B Column C
    Red Toys - Wk27 7 Yes
    Blue Toys - Wk32 5 No
    Purple Toys - Wk27 3 Maybe

    I want to 'lookup' Wk27, and return the value of 10.

    Thank you!

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Try this formula:

    =SUMPRODUCT((RIGHT(A2:A100,4)="Wk27")*(B2:B100))

    HTH

    Jason

  3. #3
    Forum Contributor
    Join Date
    02-25-2008
    Location
    Windsor, ON Canada
    MS-Off Ver
    Excel 2007, 2003
    Posts
    119
    That worked! I REALLY need to use that SUMPRODUCT function better. Very handy. Thanks Jason!

  4. #4
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    No problem. Glad it worked for you.

  5. #5
    Forum Contributor
    Join Date
    02-25-2008
    Location
    Windsor, ON Canada
    MS-Off Ver
    Excel 2007, 2003
    Posts
    119
    This formula worked in the cell I inputted it to, but I'm having trouble copying and editing it to suit my other rows. In particular, I have the formula referencing other sheets in my workbook, and each time I copy this formula to a new row, I need to reference a new worksheet. I'm getting a #VALUE! error when I manually change the old referenced sheet to the new sheet I need. Any ideas why this is happening?

  6. #6
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    Please post the formula that is giving you this problem.

    Richard
    Richard Schollar
    Microsoft MVP - Excel

  7. #7
    Forum Contributor
    Join Date
    02-25-2008
    Location
    Windsor, ON Canada
    MS-Off Ver
    Excel 2007, 2003
    Posts
    119
    =SUMPRODUCT((RIGHT(RDW0100!$A$15:$A$69,4)=H$42)*(RDW0100!$B$15:$B$69))

    I want to be able to change RDW0100 to RDW0098, RDW0112 - whichever the worksheet may be. Each worksheet represents a project, and I'm trying to summarize all projects' labour-hours by week on a summary page.

  8. #8
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    Nothing wrong with the formula (that I can see) that should result in a #VALUE! result so do you have any #VALUE!s in the referenced cell ranges in the source sheets?

  9. #9
    Forum Contributor
    Join Date
    02-25-2008
    Location
    Windsor, ON Canada
    MS-Off Ver
    Excel 2007, 2003
    Posts
    119
    Oh good idea! But, unfortunately no.
    I think I figured out why I'm getting the error. The formula works great until I run into a text (title) in column B, and then it has a fit. Does that make sense?

+ 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