+ Reply to Thread
Results 1 to 7 of 7

Using MATCH function with dynamic range from a different sheet

  1. #1
    Registered User
    Join Date
    08-07-2012
    Location
    Sarasota, FL
    MS-Off Ver
    Excel 2010
    Posts
    3

    Using MATCH function with dynamic range from a different sheet

    I have 2 sheets in a workbook - "Main" and Insurance". "Main" has a list in Col A of 25 locations with letter designations (A, B, C, D etc). "Insurance"" has 12 columns of document names to be tracked for each location also in column A. Until documents are received each column is marked "missing" for that location. On the Main sheet, I can summarize the insurance status for each location with following formula:

    =IF(ISNA(MATCH("missing",Insurance!A5:M5,0)),"Complete","Incomplete").

    Here's the challenge I can't resolve. The range A5:M5 in the example above must be dynamic, because the locations on the Insurance sheet will change due to sorting, etc. So A5:M5 could become A12:M12 the next day. I've been able to use Match to identify the corresponding row on "Insurance" for a given location, but I can't resolve the whole range address to make it work. I can use a formula or UDF to make this work.
    Thanks in advance!

    jtaxtim

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Using MATCH function with dynamic range from a different sheet

    Explore the OFFset function to define the array. If you have found the row using Match, define the width in the offset function and you should be home!
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,625

    Re: Using MATCH function with dynamic range from a different sheet

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post, you need to be using the main 'New Post' or 'New Thread' page and not 'Quick Reply'.
    To use the main 'New Post' page, click the 'Post Reply' button in the relevant thread.


    On this page, below the message box, you will find a button labelled 'Manage Attachments'.
    Clicking this button will open a new window for uploading attachments.


    You can upload an attachment either from your computer or from another URL by using the appropriate box on this page.
    Alternatively you can click the Attachment Icon to open this page.


    To upload a file from your computer, click the 'Browse' button and locate the file.


    To upload a file from another URL, enter the full URL for the file in the second box on this page.
    Once you have completed one of the boxes, click 'Upload'.


    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    Ben Van Johnson

  4. #4
    Registered User
    Join Date
    08-07-2012
    Location
    Sarasota, FL
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Using MATCH function with dynamic range from a different sheet

    I did attempt to use OFFSET, but that approach also requires me to resolve the sheet name reference in OFFSET - Insurance!A5
    This formula works when typed manually,
    =MATCH("missing",OFFSET(Insurance!A5,0,0,1,8),0)

    I was able to create Insurance!A5 using concatenate:
    =CONCATENATE("Insurance!",ADDRESS(MATCH(A3,Insurance!A:A,0),1,4,1))

    But when I substitute the above formula in the MATCH or OFFSET function, I get "The formula you typed contains an error". Is there a sytax error in my concatenation?

    See my uploaded file.
    Thanks for any ideas!
    jtaxTim

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,625

    Re: Using MATCH function with dynamic range from a different sheet

    MAIN!B2:
    Please Login or Register  to view this content.
    MAIN!C2:
    =IF(A2="","",OFFSET(Insurance!$D$1,MATCH(A2,Insurance!A:A,0)-1,0))
    MAIN!E2:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-07-2012
    Location
    Sarasota, FL
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Using MATCH function with dynamic range from a different sheet

    Ben, that works perfectly! Thank you so much for your help! I'll add this gem to my vba toolbox for future reference.
    I'm new to the Excel Forum and already a big fan. Keep up the great work!
    Tim

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Using MATCH function with dynamic range from a different sheet

    @ jtaxtim

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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