+ Reply to Thread
Results 1 to 6 of 6

Lookup with header conditions and dynamic range

  1. #1
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    810

    Lookup with header conditions and dynamic range

    Hi,

    I have sample data arranged as in columns A:D in the attached worksheet.

    I would like to create a formula in cell H3 that will extract from this data the sum of the values associated with the product type named in cell G3 and from the column defined by the text that's in cells H1 and H2.

    In addition to using the text in cells H1 and H2 to determine the column from which the data is to be summed, I'd also like to make this range dynamic so that it will extend as far as the penultimate cell in the column (the last cell is the total which I don't want summed).

    The number of columns and rows in the actual workbook will be far more than shown here so it would be preferable to have a dynamic solution as suggested above.

    This has proven to be beyond my skills so could someone kindly please suggest a solution?

    Thanks!

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Lookup with header conditions and dynamic range

    Hi andrewc,
    Enter formula in cell H3
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    810

    Re: Lookup with header conditions and dynamic range

    Excellent, thank you!

  4. #4
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    810

    Re: Lookup with header conditions and dynamic range

    Something I've noticed is that the solution above doesn't consider second condition, in cell H2.

    Can someone please suggest how to amend this formula to take account of that.

    Thanks!

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Lookup with header conditions and dynamic range

    Quote Originally Posted by andrewc View Post
    Something I've noticed is that the solution above doesn't consider second condition, in cell H2.

    Can someone please suggest how to amend this formula to take account of that.

    Thanks!
    If you referring to cells C2 and D2 ("Weight") they can't be used as criteria simply because they are not present in your data table.
    another thought: Use this array formula

    **Must be entered with Ctrl+Shift+Enter key combination.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    But it won't make any difference in the outcome.
    Last edited by AlKey; 02-26-2018 at 06:46 PM.

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Lookup with header conditions and dynamic range

    Or use regular formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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. Dynamic range count minus header row (first row)
    By nobodyukno in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-29-2017, 03:35 AM
  2. Replies: 13
    Last Post: 03-28-2014, 09:36 AM
  3. [SOLVED] How to create a dynamic dropdown based on multiple lookup conditions
    By psilens in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 02-06-2014, 10:05 AM
  4. [SOLVED] Create Dynamic Column Lookup Reference based on Table Header
    By jeversf in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-22-2013, 12:49 PM
  5. Retaining proper pivot header of dynamic single column range
    By VTHokie11 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-26-2011, 03:03 PM
  6. How do I set a dynamic range based on the column header?
    By gimiv in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2007, 03:25 PM
  7. [SOLVED] Creating a Dynamic Named Range Using Sheet Name and Column Header
    By burl_rfc_h in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-13-2006, 06:55 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