+ Reply to Thread
Results 1 to 9 of 9

Vlookup with wild-card and multiple lookup values

  1. #1
    Registered User
    Join Date
    09-12-2014
    Location
    New York
    MS-Off Ver
    2010
    Posts
    16

    Vlookup with wild-card and multiple lookup values

    Hello,

    I'm trying to find a formula that will solve the attached. I would like to use a 2-digit number as a look-up value to find matching number+letter codes, and then add the corresponding column amounts together. I'm using a wildcard because the look-up value will only contain the 2-digit number. So far I cannot get this to work using VLookup since it only looks at the first value, but I'm not sure how to move past this.

    Does anyone have any ideas on how this could work?

    Thanks,
    Jason
    Attached Files Attached Files

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Vlookup with wild-card and multiple lookup values

    Hi Jason,

    Try...

    =SUMPRODUCT(--(LEFT('MARKET SEGMENT'!$A$4:$A$12,2)+0=H4),'MARKET SEGMENT'!$C$4:$C$12)
    Last edited by jeffreybrown; 09-27-2014 at 07:19 PM.
    HTH
    Regards, Jeff

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Vlookup with wild-card and multiple lookup values

    Hi,

    See attached.

    I've also added a Pivot Table option which you may find more useful, and certainly more flexible.

    ...late edit. Column I on the Calculate sheet should of course be formatted as numbers not as $ of course
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Vlookup with wild-card and multiple lookup values

    Try this, copied down and across, instead...
    =SUMIF('MARKET SEGMENT'!$A$4:$A$12,$A4&"*",'MARKET SEGMENT'!B$4:B$12)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    09-12-2014
    Location
    New York
    MS-Off Ver
    2010
    Posts
    16

    Re: Vlookup with wild-card and multiple lookup values

    Thanks for your replies! The SUMIF function works, but the range will not always be the same. The MARKET SEGMENT I used was just a small example of a larger file that is copied into the worksheet each day. I've attached a revised file with the actual data for one day in the REAL MARKET SEGMENT tab.

    The data I'm looking for is in columns L & M, based on what's in column A. The data for a particular day could start a few rows above or below row 84. Can the range in the SUMIF function be made variable to account for different beginning row number?

    Thank you,
    Jason
    Attached Files Attached Files

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Vlookup with wild-card and multiple lookup values

    can you add a helper column to help ID the day?

  7. #7
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Vlookup with wild-card and multiple lookup values

    Hi Jason..
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    For Upper range
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    For Lower Range
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Check the attached file....
    and tell is that you desired..
    Attached Files Attached Files
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  8. #8
    Registered User
    Join Date
    09-12-2014
    Location
    New York
    MS-Off Ver
    2010
    Posts
    16

    Re: Vlookup with wild-card and multiple lookup values

    Thank you for all the replies to my question!

    I've solved this using the SUMIFS formulas provided, but can I ask a follow-up question? There are 2 rows in the range that have the words "TOTALS" and "SUBTOTAL" in them, and this is making the calculations incorrect. I've tried to insert "<>*TOTALS*", "<>*SUBTOTAL*" into the formula, but I'm getting error messages no matter where I insert. For example, this gives me an error message:

    Please Login or Register  to view this content.
    Is there a way to amend the SUMIFS formula to have the 2 rows with these 2 words not included?

    Many Thanks,
    Jason

  9. #9
    Registered User
    Join Date
    09-12-2014
    Location
    New York
    MS-Off Ver
    2010
    Posts
    16

    Re: Vlookup with wild-card and multiple lookup values

    I figured out how to exclude the words "SUBTOTAL" and "TOTALS" using the code below:

    Please Login or Register  to view this content.
    Thanks for the help with this one.

    Jason

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. vlookup using wild card in table array
    By decisys in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-03-2014, 12:03 PM
  2. Max, Min, & Std Dev with Multiple Criteria Including a Wild Card
    By rmmohan in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-14-2013, 12:45 PM
  3. wild card in macro for worksheet lookup
    By jw01 in forum Excel General
    Replies: 1
    Last Post: 06-22-2012, 10:45 AM
  4. Wild Card with Text Values
    By Wkruger in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-22-2010, 10:29 PM
  5. Move multiple files with wild card name
    By randell.graybill in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-14-2010, 10:31 PM

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