+ Reply to Thread
Results 1 to 4 of 4

Adjust array to column guided by cell value

  1. #1
    Registered User
    Join Date
    06-28-2022
    Location
    mexico
    MS-Off Ver
    microsoft 365
    Posts
    3

    Adjust array to column guided by cell value

    Test Document.xlsx

    The attached document explains my issue. Please refer to cells C3 to E3 on sheet called "Data Presentation", I am trying to make the array inside my MATCH function adjust itself depending on the column where the VLOOKUP value is located (inside sheet called "Mold"). As you can see, the information that is being pulled out of my table does not match with what it is stated in it.

    Thanks!

  2. #2
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365 Version 2412
    Posts
    1,508

    Re: Adjust array to column guided by cell value

    Hi.

    You can use the INDEX function to create a dynamic range for your MATCH function.
    So, instead of the hard coded Mold!C6:C9, you can try INDEX(Mold!$C$6:$E$9,0,C$2).
    Mold!$C$6:$E$9 is the whole range, with all three columns.
    The second argument in the INDEX function determines the row number, so when you type 0 (zero) for this argument, the Excel will consider all rows.
    The third argument determines the column number, and for that we use the value in the heading row, C2.

    I have also shortened up your VLOOKUPS, since you have locked the range to the first row.
    The formula in C3 would be like:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Then you can drag it across.

    Good luck!
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    06-28-2022
    Location
    mexico
    MS-Off Ver
    microsoft 365
    Posts
    3

    Re: Adjust array to column guided by cell value

    Hello Estevaoba,

    This is just what I was looking for, it works perfectly. I wasn´t aware that a 0 meant that in the INDEX function.
    Thanks for helping me out!

  4. #4
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365 Version 2412
    Posts
    1,508

    Re: Adjust array to column guided by cell value

    You're welcome. Glad to help.
    Thank you for the feedback and for the reputation added.
    Have a blessed day!

+ 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. adjust column width based on empty cell within same column
    By vascobmcastro in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-23-2020, 01:27 PM
  2. Replies: 1
    Last Post: 02-04-2019, 09:17 AM
  3. [SOLVED] Adjust column width when specific cell value changes.
    By JO505 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-24-2015, 03:14 PM
  4. [SOLVED] Auto Adjust Stacked Column Need to Adjust Legend
    By tbren in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 03-29-2013, 01:56 PM
  5. [SOLVED] how to adjust the width of a cell and not the entire column
    By gabrie ruz in forum Excel General
    Replies: 3
    Last Post: 08-03-2006, 01:00 PM
  6. User guided button???
    By locutus243 in forum Excel General
    Replies: 5
    Last Post: 11-09-2005, 08:20 AM
  7. User Guided Button???
    By locutus243 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-09-2005, 06:50 AM

Tags for this Thread

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